home *** CD-ROM | disk | FTP | other *** search
/ Scene 96 / Scene 96 International Edition (Zyklop Software) (Disc 2) (1997).iso / player / dplay300 / eos300.doc < prev    next >
Text File  |  1996-12-08  |  235KB  |  5,811 lines

  1. ───────────────────────────────────────────────────────────────────────────────
  2.                      ┌─────────┐ ┌─────────┐ ┌─────────┐
  3.                      └┐  ┌───┐ │ │  ┌───┐  │ │  ┌────┐ │
  4.                       │  │   └─┘ │  │   │  │ │  │    └─┘
  5.                       │  └──┐    │  │   │  │ │  └──────┐
  6.                       │  ┌──┘    │  │   │  │ └──────┐  │
  7.                       │  │   ┌─┐ │  │   │  │ ┌─┐    │  │
  8.                      ┌┘  └───┘ │ │  └───┘  │ │ └────┘  │
  9.                      └─────────┘ └─────────┘ └─────────┘
  10. ───────────────────────────────────────────────────────────────────────────────
  11.  
  12. ───────────────────────────────────────────────────────────────────────────────
  13.  
  14.               E.O.S Eclipse Operating System  Version 3.00 Bêta
  15.  
  16.                         Copyright (c) Eclipse 1995-96
  17.  
  18. ───────────────────────────────────────────────────────────────────────────────
  19.  
  20.  
  21. ╔══════════════════════════════════════════════════════════════════════════╗
  22. ║                                                                          ║
  23. ║ Nouveautés de la version 3.00                                            ║
  24. ║                                                                          ║
  25. ╚══════════════════════════════════════════════════════════════════════════╝
  26.  
  27.         * Un seul fichier E.O.S (plus de fichier kernel).
  28.         * Compatibilité totale avec Windows 95, Windows 3.1 et Dos.
  29.         * Nouvelles librairies pour les utilisateurs de WATCOM C++.
  30.         * Possibilité d'utiliser l'E.O.S à la place de DOS4GW.
  31.         * Support du VESA 2.0 (Linear frame buffer).
  32.         * Support du VESA 1.0 (Automatic Bank Switching) en lecture et écriture.
  33.         * Nouvelle interruption pour remapper la mémoire.
  34.         * Nouveau debugger en externe pour tracer des programmes au format LE.
  35.         * Serveur DPMI Version 0.90.
  36.         * Nouvelle gestion de la mémoire par handle.
  37.         * Possibilité de linker des données sans les compresser.
  38.         * Possibilité d'utiliser l'E.O.S en externe sous WATCOM (WSTUB).
  39.         * Nouvelle fonction de synchronisation beaucoup plus stable sous
  40.           Windows 95.
  41.         * Nouveau player de module :
  42.            - Mixage automatique sur 8 ou 16bits en fonction de la carte.
  43.            - Meilleure restitution sonore sur les cartes Sound Blaster.
  44.            - Support de la Windows Sound System.
  45.            - Gestion des samples indépendamment de la musique.
  46.            - Détection manuelle ou automatique des cartes sonores.
  47.  
  48.  
  49. ╔══════════════════════════════════════════════════════════════════════════╗
  50. ║                                                                          ║
  51. ║ Table des matières                                                       ║
  52. ║                                                                          ║
  53. ╚══════════════════════════════════════════════════════════════════════════╝
  54.  
  55.       Présentation des différents modules de l'E.O.S
  56.       Comment créer un fichier OBJ
  57.       Comment créer un fichier EXE
  58.       Utilisation d'un fichier makefile avec Turbo Assembler
  59.       Utilisation d'un fichier makefile avec WATCOM C++
  60.       Le fichier include
  61.       Les différentes fonctionnalités de l'E.O.S
  62.       Les déclarations générales
  63.       La gestion mémoire
  64.       Les fonctions pour la gestion mémoire
  65.            │Allocate Memory
  66.            │DeAllocate Memory
  67.            │Allocate Memory Handle
  68.            │DeAllocate Memory Handle
  69.            │Resize Memory Handle
  70.            │Allocate Selector
  71.            │DeAllocate Selector
  72.            │Physical Address Mapping
  73.            │Free Physical Address Mapping
  74.       La gestion de fichiers
  75.       Les fonctions pour la gestion de fichiers
  76.            │Load Internal File
  77.            │Load External File
  78.            │Load Internal File Handle
  79.            │Load External File Handle
  80.            │Write External File
  81.       La gestion des cartes sonores
  82.       Comment accéder aux différentes variables d'un module
  83.       Les effets sonores
  84.       Absence de carte sonores
  85.       Les déclarations du player de module
  86.       Les fonctions pour jouer une musique ou des effets sonores
  87.            │Detect Sound Card
  88.            │Manual Setup
  89.            │Load Module
  90.            │Play Module
  91.            │Stop Module
  92.            │Clear Module
  93.            │Set Volume
  94.            │Play Sample
  95.            │Get Info
  96.            │Set Pattern
  97.       Gestion d'un second écran monochrome
  98.       Les fonctions pour utiliser un second écran pour le debuggage
  99.            │Set Mono
  100.            │Set String Mono
  101.            │Set Value Mono
  102.       Le clavier
  103.            │Use Int 09
  104.       Synchronisation avec le balayage
  105.       Les fonctions de synchronisations
  106.            │Wait Vbl
  107.            │Use Int 08
  108.            │Change Synchro Int 08
  109.       Les variables
  110.            │Code32 Sel
  111.            │Data32 Sel
  112.            │Flat Data Sel
  113.            │Flat Code Sel
  114.            │Sélecteur 40h
  115.            │Real DS
  116.            │Real ES
  117.            │Real FS
  118.            │Real GS
  119.            │Real SS
  120.            │Real SP
  121.            │0b0000h
  122.            │0b8000h
  123.            │0a0000h
  124.       Les Macros
  125.            │Colors
  126.            │Get Param
  127.            │Send
  128.            │DosInt
  129.            │DosCall
  130.            │Init ES DI
  131.            │Init DS DX
  132.       Le mode réel
  133.       Les interruptions
  134.       Les IRQ ou interruptions matérielles
  135.       Les Exceptions
  136.       Les fonctions pour gérer les interruptions
  137.            │Get Int
  138.            │Set Int
  139.            │Get Irq
  140.            │Set Irq
  141.       Le linker
  142.       Le Debugger 32 bits
  143.       Les fonctions du Debuggeur 32 bits
  144.            │Debug
  145.            │Debug Back
  146.       Appel du debugger par Break point
  147.            │Break Point
  148.       Restitution automatique de l'environement de départ
  149.       Les fonctions système
  150.            │Exit Error
  151.            │Restore Video Mode
  152.            │Detect Windows
  153.            │Direct Send
  154.       Comment développer une librairie compatible WATCOM C et E.O.S
  155.            │La gestion mémoire sous WATCOM
  156.            │Les appels aux interruptions en mode REEL
  157.            │Les variables inutilisables sous WATCOM
  158.            │Différence entre les fichiers sources
  159.       Les librairies de l'E.O.S
  160.       La librairie VESA
  161.            │Automatic Bank Switching en VESA 1.0 ou 2.0
  162.            │Linear Frame Buffer en VESA 2.0
  163.       Les fonctions de la librairie VESA
  164.            │Init Vesa
  165.            │Init Vesa2
  166.            │Init Vesa Bank
  167.            │Close Vesa Bank
  168.            │Set Bank
  169.       Les variables de la librairie VESA
  170.            │Vesa Clear Palette
  171.       Les déclarations de la librairie VESA
  172.       La librairie FLI32
  173.       Les fonctions de la librairie FLI32
  174.            │Load Fli
  175.            │Load Internal Fli
  176.            │First Frame Fli
  177.            │Next Frame Fli
  178.            │Dispose Fli
  179.       La librairie SNAP
  180.       Les fonctions de la librairie SNAP
  181.            │Init Snap
  182.            │Snap IFF
  183.            │Save IFF
  184.       La librairie JOYSTICK
  185.       Les fonctions de la librairie JOYSTICK
  186.            │Init Joystick
  187.            │Dectect Joystick
  188.            │Add Joystick
  189.            │Update Joystick
  190.            │Sub Joystick
  191.            │Upper Left
  192.            │Lower Right
  193.            │Center
  194.       Les déclarations de la librairie JOYSTICK
  195.       La librairie mémoire
  196.       Les fonctions de la librairie mémoire
  197.            │Init Memory
  198.       Les fonctions du DPMI (interruption 31h) supportées par l'E.O.S
  199.       Les fonctions du DOS (interruption 21h) supportées par l'E.O.S
  200.  
  201.  
  202. ╔══════════════════════════════════════════════════════════════════════════╗
  203. ║                                                                          ║
  204. ║ Présentation des différents modules de l'E.O.S                           ║
  205. ║                                                                          ║
  206. ╚══════════════════════════════════════════════════════════════════════════╝
  207.  
  208. L'E.O.S est constitué de plusieurs fichiers.
  209.  
  210.  
  211. ───────────────────────────────────────────────────────────────────────────────
  212. Version d'évaluation
  213. ───────────────────────────────────────────────────────────────────────────────
  214.  
  215.         Les objets de base pour Tasm et Masm :
  216.  
  217.                 ■ EOS.OBJ       Le coeur du système qui supporte Diamond.
  218.                 ■ EOSLITE.OBJ   La version allégée si vous n'utilisez pas
  219.                 ■ DIAMOND.OBJ   Le player de module 32 voies.
  220.                 ■ EOS.INC       Le fichier include.
  221.  
  222.  
  223.         Les objets de base pour WATCOM C++ :
  224.  
  225.                 ■ WEOS.EXE      Le coeur du système qui supporte Diamond.
  226.                   WSTARTUP.OBJ
  227.                   WATCOM.OBJ
  228.                 ■ WEOSLITE.EXE  La version allégée si vous n'utilisez pas
  229.                                 le player Diamond.
  230.  
  231.                 ■ EOS.H         Le fichier include.
  232.  
  233.  
  234.         Le debuggeur pour Tasm, Masm et WATCOM C++ :
  235.  
  236.                 ■ DEBUG.OBJ     Pour tracer du code 32 bits.
  237.  
  238.  
  239.         Les outils :
  240.  
  241.                 ■ LLINK.EXE     Pour créer un seul fichier EXE compressé.
  242.                 ■ CRYPT.EXE     Pour protéger vos données.
  243.                 ■ SCANCODE.EXE  Pour afficher les codes du clavier.
  244.                 ■ 132.EXE       Pour passer en mode 132 colonnes.
  245.                 ■ EDCONFIG.EXE  Pour configurer le debugger
  246.                 ■ DIET.EXE      Pour compresser vos données
  247.                 ■ DIAMOND.EXE   Pour tester un module
  248.  
  249.  
  250. ───────────────────────────────────────────────────────────────────────────────
  251. Version Complète
  252. ───────────────────────────────────────────────────────────────────────────────
  253.  
  254.         Les objets de base pour Tasm et Masm :
  255.  
  256.                 ■ EOS.OBJ       Le coeur du système qui supporte Diamond.
  257.                 ■ EOSLITE.OBJ   La version allégée si vous n'utilisez pas
  258.                                 le player Diamond.
  259.                 ■ DIAMOND.OBJ   Le player de module 32 voies.
  260.  
  261.                 ■ EOS.INC       Le fichier include.
  262.  
  263.  
  264.         Les objets de base pour WATCOM C++ :
  265.  
  266.                 ■ WEOS.EXE      Le coeur du système qui supporte Diamond.
  267.                   WSTARTUP.OBJ
  268.                   WATCOM.OBJ
  269.                 ■ WEOSLITE.EXE  La version allégée si vous n'utilisez pas
  270.                                 le player Diamond.
  271.  
  272.                 ■ EOS.H         Le fichier include.
  273.  
  274.  
  275.         Le debuggeur pour Tasm, Masm et WATCOM C++ :
  276.  
  277.                 ■ DEBUG.OBJ     Pour tracer du code 32 bits.
  278.                *■ MEMORY.OBJ    Pour la gestion de la mémoire.
  279.  
  280.  
  281.         Les Librairies TASM et MASM :
  282.  
  283.                *■ VESA.OBJ      Pour accéder directement au buffer de la
  284.                                 carte graphique sans se préoccuper des
  285.                                 changements de bank en VESA 1.0.
  286.                *■ FLI32.OBJ     Pour visualiser les fichiers FLI et FLC.
  287.                *■ SNAP.OBJ      Pour la capture d'écrans 256 couleurs
  288.                                 au format IFF.
  289.                *■ JOYSTICK.OBJ  Pour la gestion des manettes de jeux.
  290.  
  291.  
  292.         Les librairies pour Wactom C++ :
  293.  
  294.                *■ WVESA.OBJ     Pour accéder directement au buffer de la
  295.                                 carte graphique sans se préoccuper des
  296.                                 changements de bank en VESA 1.0.
  297.                *■ WFLI32.OBJ    Pour visualiser les fichiers FLI et FLC.
  298.                *■ WSNAP.OBJ     Pour la capture d'écrans 256 couleurs
  299.                                 au format IFF.
  300.                *■ WJOYSTICK.OBJ Pour la gestion des manettes de jeux.
  301.  
  302.  
  303.         Les outils :
  304.  
  305.                 ■ LLINK.EXE     Pour créer un seul fichier EXE compressé.
  306.                 ■ CRYPT.EXE     Pour protéger vos données.
  307.                 ■ SCANCODE.EXE  Pour afficher les codes du clavier.
  308.                 ■ 132.EXE       Pour passer en mode 132 colonnes.
  309.                 ■ EDCONFIG.EXE  Pour configurer le debugger
  310.                 ■ DIET.EXE      Pour compresser vos données
  311.                 ■ DIAMOND.EXE   Pour tester un module
  312.                *■ WSTUB.EXE     Pour utiliser l'E.O.S en externe.
  313.                *■ WSTUBLTE.EXE  Version allégée sans Diamond.
  314.                *■ WDEBUG.EXE    Pour debugger des programmes au format LE.
  315.  
  316.  
  317. ╔══════════════════════════════════════════════════════════════════════════╗
  318. ║                                                                          ║
  319. ║ Comment créer un fichier OBJ                                             ║
  320. ║                                                                          ║
  321. ╚══════════════════════════════════════════════════════════════════════════╝
  322.  
  323.          A partir de l'invité de MS-Dos, taper simplement :
  324.  
  325.                 TASM3 Mon_programme.asm /m /q /p
  326.  
  327.  
  328. ╔══════════════════════════════════════════════════════════════════════════╗
  329. ║                                                                          ║
  330. ║ Comment créer un fichier EXE                                             ║
  331. ║                                                                          ║
  332. ╚══════════════════════════════════════════════════════════════════════════╝
  333.  
  334.         Si vous n'utilisez pas le player de module :
  335.  
  336.                 TLINK eoslite+Mon_programme /3 /x
  337.  
  338.  
  339.         Si vous utilisez le player de module :
  340.  
  341.                 TLINK eos+diamond+Mon_programme /3 /x
  342.  
  343.  
  344.         Si vous utilisez une librairie :
  345.  
  346.                 TLINK  eos+diamond+Ma_librairie+Mon_programme /3 /x
  347.  
  348.  
  349. ╔══════════════════════════════════════════════════════════════════════════╗
  350. ║                                                                          ║
  351. ║ Utilisation d'un fichier makefile avec Turbo Assembler                   ║
  352. ║                                                                          ║
  353. ╚══════════════════════════════════════════════════════════════════════════╝
  354.  
  355. Le programme MAKE.EXE de Borland permet d'automatiser les commandes
  356. d'assemblage et de linkage à l'aide d'un seul fichier script.
  357.  
  358. Exemple de fichier makefile :
  359.  
  360.         PRG = EXAMPLE1
  361.         RES = ..\RESOURCE
  362.  
  363.         $(PRG).exe:    $(PRG).obj                  \
  364.  
  365.                 @tlink $(RES)\eoslite              \
  366.                        $(PRG),$(PRG).EXE /3 /x
  367.  
  368.         $(PRG).obj: $(PRG).asm
  369.                 @tasm3  $(PRG) /m /q /p
  370.  
  371. Pour créer votre exécutable, taper simplement MAKE.
  372.  
  373.  
  374. ╔══════════════════════════════════════════════════════════════════════════╗
  375. ║                                                                          ║
  376. ║ Utilisation d'un fichier makefile avec WATCOM C++                        ║
  377. ║                                                                          ║
  378. ╚══════════════════════════════════════════════════════════════════════════╝
  379.  
  380. Le programme WMAKE.EXE de WATCOM permet d'automatiser les commandes
  381. d'assemblage et de linkage comme avec Make.
  382.  
  383. Exemple de fichier makefile :
  384.  
  385.         PROGNAME = TEST
  386.         RES      = ..\RESOURCE
  387.  
  388.         CFLAGS = /i=$(%WATCOM)\H /j /mf /fpi87 /fp3 /4s /oailt -4
  389.         CC = WCC386
  390.  
  391.         .c.obj:
  392.                 $(CC) $(CFLAGS) $*.c
  393.  
  394.         all: $(PROGNAME).exe .SYMBOLIC
  395.  
  396.         $(PROGNAME).obj : $(PROGNAME).c
  397.  
  398.         $(PROGNAME).exe : $(PROGNAME).obj
  399.  
  400.            %create link.opt
  401.            %append link.opt FILE $(PROGNAME)
  402.            %append link.opt LIBPATH $(%WATCOM)\LIB386;$(%WATCOM)\LIB386\DOS
  403.            %append link.opt LIBRARY CLIB3S.LIB
  404.            %append link.opt LIBRARY MATH387S.LIB
  405.            %append link.opt OPTION DOSSEG
  406.            %append link.opt option osname='Eclipse Operating System'
  407.            %append link.opt name $(PROGNAME)
  408.            %append link.opt option stub=$(RES)\WEOSLITE.EXE
  409.            %append link.opt format os2 le
  410.            @wlink @link.opt
  411.            @if exist link.opt del link.opt
  412.  
  413. Pour créer votre exécutable, taper simplement WMAKE.
  414.  
  415.  
  416. ╔══════════════════════════════════════════════════════════════════════════╗
  417. ║                                                                          ║
  418. ║ Le fichier include                                                       ║
  419. ║                                                                          ║
  420. ╚══════════════════════════════════════════════════════════════════════════╝
  421.  
  422. Le fichier include (EOS.INC ou EOS.H) est certainement le fichier le plus
  423. important. Il contient en effet toutes les déclarations des différentes
  424. fonctions, macros et variables de l'E.O.S C'est grâce à lui que votre
  425. programme est en mesure de dialoguer avec l'E.O.S.
  426.  
  427.  
  428. ╔══════════════════════════════════════════════════════════════════════════╗
  429. ║                                                                          ║
  430. ║ Les différentes fonctionnalités de l'E.O.S                               ║
  431. ║                                                                          ║
  432. ╚══════════════════════════════════════════════════════════════════════════╝
  433.  
  434. Le système E.O.S dispose d'un certain nombre de fonctions très utiles que l'on
  435. peut appeler par l'intermédiaire de l'interruption Int_EOS.
  436.  
  437. Il suffit juste d'indiquer la fonction voulue à l'aide du registre AH comme
  438. ci-dessous :
  439.  
  440.         mov ah,Fonction_a_appeler
  441.         Int_EOS
  442.  
  443.  
  444. Les fonctions disponibles sont les suivantes :
  445.  
  446. EOS.OBJ
  447. ┌──────────────────────────────────────────────────────────────────────────┐
  448. │Allocate Memory                                                           │
  449. │DeAllocate Memory                                                         │
  450. │Allocate Memory Handle                                                    │
  451. │DeAllocate Memory Handle                                                  │
  452. │Resize Memory Handle                                                      │
  453. │Allocate Selector                                                         │
  454. │DeAllocate Selector                                                       │
  455. │Physical Address Mapping                                                  │
  456. │Free Physical Address Mapping                                             │
  457. │                                                                          │
  458. │Load Internal File                                                        │
  459. │Load External File                                                        │
  460. │Load Internal File Handle                                                 │
  461. │Load External File Handle                                                 │
  462. │Write External File                                                       │
  463. │                                                                          │
  464. │Set Mono                                                                  │
  465. │Set String Mono                                                           │
  466. │Set Value Mono                                                            │
  467. │                                                                          │
  468. │Use Int 09                                                                │
  469. │                                                                          │
  470. │Wait Vbl                                                                  │
  471. │Use Int 08                                                                │
  472. │Change Synchro Int 08                                                     │
  473. │                                                                          │
  474. │Get Int                                                                   │
  475. │Set Int                                                                   │
  476. │Get Irq                                                                   │
  477. │Set Irq                                                                   │
  478. │                                                                          │
  479. │Exit Error                                                                │
  480. │                                                                          │
  481. │Restore Vidèo Mode                                                        │
  482. │                                                                          │
  483. │Detect Windows                                                            │
  484. │                                                                          │
  485. │Direct Send                                                               │
  486. └──────────────────────────────────────────────────────────────────────────┘
  487.  
  488. DIAMOND.OBJ
  489. ┌──────────────────────────────────────────────────────────────────────────┐
  490. │Detect Sound Card                                                         │
  491. │Manual Setup                                                              │
  492. │Load Module                                                               │
  493. │Play Module                                                               │
  494. │Stop Module                                                               │
  495. │Clear Module                                                              │
  496. │Set Volume                                                                │
  497. │Play Sample                                                               │
  498. │Get Info                                                                  │
  499. │Set Pattern                                                               │
  500. └──────────────────────────────────────────────────────────────────────────┘
  501.  
  502.  
  503. ╔══════════════════════════════════════════════════════════════════════════╗
  504. ║                                                                          ║
  505. ║ Les Déclarations gébérales                                               ║
  506. ║                                                                          ║
  507. ╚══════════════════════════════════════════════════════════════════════════╝
  508.  
  509. Pour faciliter l'écriture de vos programmes, l'E.O.S dispose de quelques
  510. déclarations générales très pratiques :
  511.  
  512.   On         = 1
  513.   Off        = 0
  514.   B          = Byte Ptr
  515.   W          = Word Ptr
  516.   D          = Dword Ptr
  517.   F          = Fword Ptr
  518.   O          = Offset
  519.  
  520. Exemple :
  521.  
  522.         mov edi, O File_Name
  523.  
  524.         ou
  525.  
  526.         mov edi, Offset File_Name
  527.  
  528.  
  529. ╔══════════════════════════════════════════════════════════════════════════╗
  530. ║                                                                          ║
  531. ║ La gestion mémoire                                                       ║
  532. ║                                                                          ║
  533. ╚══════════════════════════════════════════════════════════════════════════╝
  534.  
  535. Avec l'E.O.S, finit les problèmes de mémoire ! Vous pouvez désormais adresser
  536. linéairement toutes la mémoire disponible et cela quelques que soit la
  537. configuration de votre système :
  538.  
  539.         ■ Mode RAW  sans Himem.
  540.         ■ Mode XMS  avec Himem.
  541.         ■ Mode VCPI avec EMS (Emm386 highscan).
  542.         ■ Mode VCPI sans EMS (Emm386 noems).
  543.         ■ Mode DPMI avec Windows 3.1x.
  544.         ■ Mode DPMI avec Windows 95.
  545.         ■ Mode DPMI avec OS/2 2.1 ou OS/2 Warp.
  546.  
  547.  
  548. Pour allouer ou restituer de la mémoire supérieur, une simple
  549. interruption de l 'E.O.S suffit :
  550.  
  551.  
  552.         Allocation sans handle :
  553.  
  554.                 mov ah,Allocate_Memory
  555.                 mov edx,Taille_Allocation
  556.                 Int_EOS
  557.                 jc Not_Enough_Memory
  558.                 mov [Logical_Address_Of_Block],edx
  559.  
  560.  
  561.         Restitution de la dernière allocation :
  562.  
  563.                 mov ah,DeAllocate_Memory
  564.                 Int_EOS
  565.  
  566.  
  567.         Allocation par handle :
  568.  
  569.                 mov ah,Allocate_Memory_Handle
  570.                 mov edx,Taille_Allocation
  571.                 Int_EOS
  572.                 jc Not_Enough_Memory
  573.                 mov [Logical_Address_Of_Block],edx
  574.                 mov [Memory_Handle],edi
  575.  
  576.  
  577.         Restitution par handle :
  578.  
  579.                 mov ah,DeAllocate_Memory_Handle
  580.                 mov edi,[Memory_Handle]
  581.                 Int_EOS
  582.                 jc Invalid_Handle
  583.  
  584.  
  585. Vous pouvez avec la même simplicité créer vos propres sélecteurs et profiter
  586. pleinement de la segmentation du mode protégé.
  587.  
  588.  
  589.         Allocation d'un sélecteur :
  590.  
  591.                 mov ah,Allocate_Selector
  592.                 mov esi,0a0000h     ; Base
  593.                 mov edi,0fh         ; 64ko (0000-ffff)
  594.                 Int_EOS
  595.                 jc No_Free Selector
  596.                 mov [_0a0000h_Sel],bx
  597.  
  598.  
  599.         Restitution d'un sélecteur :
  600.  
  601.                 mov ah,DeAllocate_Selector
  602.                 mov bx,[_0a0000h_Sel]
  603.                 Int_EOS
  604.                 jc Invalid_Selector
  605.  
  606.  
  607. Vous pouvez aussi remapper la mémoire pour accéder linéairement à la carte
  608. graphique :
  609.  
  610.                 mov ah,Physical_Address_Mapping
  611.                 mov ecx,1024*1024
  612.                 mov esi,[Vesa_Linear_Address]
  613.                 Int_EOS
  614.                 jc Not_Enough_Memory
  615.  
  616.  
  617. ╔══════════════════════════════════════════════════════════════════════════╗
  618. ║                                                                          ║
  619. ║ Les fonctions pour la gestion mémoire                                    ║
  620. ║                                                                          ║
  621. ╚══════════════════════════════════════════════════════════════════════════╝
  622.  
  623. ┌─────────────────────────────┐
  624. │Allocate Memory              │
  625. │DeAllocate Memory            │
  626. │Allocate Memory Handle       │
  627. │DeAllocate Memory Handle     │
  628. │Resize Memory Handle         │
  629. │Allocate Selector            │
  630. │DeAllocate Selector          │
  631. │Physical Address Mapping     │
  632. │Free Physical Address Mapping│
  633. └─────────────────────────────┘
  634.  
  635. ┌──────────────────────────────────────────────────────────────────────────┐
  636. │Allocate Memory   Allocate Upper memory                                   │
  637. │                                                                          │
  638. │In :                                                                      │
  639. │        AH = Allocate_Memory                                              │
  640. │       EDX = Size of memory block to allocate in bytes                    │
  641. │                                                                          │
  642. │Out :                                                                     │
  643. │        Carry = 0                                                         │
  644. │             All Done                                                     │
  645. │       EAX = Physical address of the block (work with Flat_Data_Sel)      │
  646. │       EDX = Logical address of the block (work with Data32_Sel)          │
  647. │                                                                          │
  648. │        Carry = 1                                                         │
  649. │             Can't allocate memory                                        │
  650. │       EAX = Largest available free memory                                │
  651. │       EDX = Total available memory                                       │
  652. │                                                                          │
  653. │Other Registers Change : None                                             │
  654. │                                                                          │
  655. │                                                                          │
  656. └──────────────────────────────────────────────────────────────────────────┘
  657.  
  658. Exemple :
  659.             mov ah,Allocate_Memory
  660.             mov edx,[Allocation_Size]
  661.             Int_EOS
  662.             jc Not_Enough_Memory
  663.             mov [Physical_Address_Of_Block],eax     ; Work with Flat_Data_Sel
  664.             mov [Logical_Address_Of_Block],edx      ; Work with Data32_Sel
  665.  
  666.  
  667. ┌──────────────────────────────────────────────────────────────────────────┐
  668. │DeAllocate Memory   Free the last allocate memory                         │
  669. │                                                                          │
  670. │In :                                                                      │
  671. │        AH = DeAllocate_Memory                                            │
  672. │                                                                          │
  673. │Out :                                                                     │
  674. │                                                                          │
  675. │Other Registers Change : None                                             │
  676. │                                                                          │
  677. │                                                                          │
  678. └──────────────────────────────────────────────────────────────────────────┘
  679.  
  680. Exemple :
  681.             mov ah,DeAllocate_Memory
  682.             Int_EOS
  683.  
  684.  
  685. ┌──────────────────────────────────────────────────────────────────────────┐
  686. │Allocate Memory Handle  Allocate Upper memory with handle                 │
  687. │                                                                          │
  688. │In :                                                                      │
  689. │        AH = Allocate_Memory                                              │
  690. │       EDX = Size of memory block to allocate in bytes                    │
  691. │                                                                          │
  692. │Out :                                                                     │
  693. │        Carry = 0                                                         │
  694. │             All Done                                                     │
  695. │       EAX = Physical address of the block (work with Flat_Data_Sel)      │
  696. │       EDX = Logical address of the block (work with Data32_Sel)          │
  697. │       EDI = Handle of Memory                                             │
  698. │                                                                          │
  699. │        Carry = 1                                                         │
  700. │             Can't allocate memory                                        │
  701. │       EAX = Largest available free memory                                │
  702. │       EDX = Total available memory                                       │
  703. │                                                                          │
  704. │Other Registers Change : None                                             │
  705. │                                                                          │
  706. │                                                                          │
  707. └──────────────────────────────────────────────────────────────────────────┘
  708.  
  709. Exemple :
  710.             mov ah,Allocate_Memory_Handle
  711.             mov edx,[Allocation_Size]
  712.             Int_EOS
  713.             jc Not_Enough_Memory
  714.             mov [Physical_Address_Of_Block],eax     ; Work with Flat_Data_Sel
  715.             mov [Logical_Address_Of_Block],edx      ; Work with Data32_Sel
  716.             mov [Memory_Handle],edi
  717.  
  718.  
  719. ┌──────────────────────────────────────────────────────────────────────────┐
  720. │DeAllocate Memory Handle  Free the allocate memory with this handle       │
  721. │                                                                          │
  722. │In :                                                                      │
  723. │        AH = DeAllocate_Memory                                            │
  724. │       EDI = Handle of Memory                                             │
  725. │                                                                          │
  726. │Out :                                                                     │
  727. │        Carry = 0                                                         │
  728. │             All Done                                                     │
  729. │                                                                          │
  730. │        Carry = 1                                                         │
  731. │             Invalid handle                                               │
  732. │                                                                          │
  733. │Other Registers Change : None                                             │
  734. │                                                                          │
  735. │                                                                          │
  736. └──────────────────────────────────────────────────────────────────────────┘
  737.  
  738. Exemple :
  739.             mov ah,DeAllocate_Memory_Handle
  740.             mov edi,[Memory_Handle]
  741.             Int_EOS
  742.             jc Invalid_Handle
  743.  
  744.  
  745. ┌──────────────────────────────────────────────────────────────────────────┐
  746. │Resize Memory Handle    Resize the allocate memory with this handle       │
  747. │                                                                          │
  748. │In :                                                                      │
  749. │        AH = Resize_Memory_Handle                                         │
  750. │       ECX = New Size of the memory block                                 │
  751. │       EDI = Handle of Memory                                             │
  752. │                                                                          │
  753. │Out :                                                                     │
  754. │        Carry = 0                                                         │
  755. │             All Done                                                     │
  756. │       EAX = Physical address of the block (work with Flat_Data_Sel)      │
  757. │       EDX = Logical address of the block (work with Data32_Sel)          │
  758. │       EDI = New Handle of Memory                                         │
  759. │                                                                          │
  760. │        Carry = 1                                                         │
  761. │             Invalid handle                                               │
  762. │             Not Enough Memory                                            │
  763. │                                                                          │
  764. │Other Registers Change : None                                             │
  765. │                                                                          │
  766. │                                                                          │
  767. └──────────────────────────────────────────────────────────────────────────┘
  768.  
  769. Exemple :
  770.             mov ah,Resize_Memory_Handle
  771.             mov edi,[Memory_Handle]
  772.             Int_EOS
  773.             jc Invalid_Handle
  774.             mov [Memory_Handle],edi
  775.             mov [Addr_Memory],edx
  776.  
  777.  
  778. ┌──────────────────────────────────────────────────────────────────────────┐
  779. │Allocate Selector   Create a new selector (Data type)                     │
  780. │                                                                          │
  781. │In :                                                                      │
  782. │        AH = Allocate_Selector                                            │
  783. │       ESI = Physical base address of the new selector                    │
  784. │       EDI = Size of the new selector modulo 4096                         │
  785. │                                                                          │
  786. │Out :                                                                     │
  787. │        Carry = 0                                                         │
  788. │             All Done                                                     │
  789. │        BX = New selector                                                 │
  790. │                                                                          │
  791. │        Carry = 1                                                         │
  792. │             Can't create selector                                        │
  793. │                                                                          │
  794. │Other Registers Change : EAX                                              │
  795. │                                                                          │
  796. │                                                                          │
  797. └──────────────────────────────────────────────────────────────────────────┘
  798.  
  799. Exemple :
  800.             mov ah,Allocate_Selector
  801.             mov esi,0a0000h
  802.             mov edi,0fh         ; 64ko (0000-ffff)
  803.             Int_EOS
  804.             jc No_Free Selector
  805.             mov [_0a0000h_Sel],bx
  806.  
  807.  
  808. ┌──────────────────────────────────────────────────────────────────────────┐
  809. │DeAllocate Selector   Free a Selector                                     │
  810. │                                                                          │
  811. │In :                                                                      │
  812. │        AH = DeAllocate_Selector                                          │
  813. │        BX = Selector                                                     │
  814. │                                                                          │
  815. │Out :                                                                     │
  816. │        Carry = 0                                                         │
  817. │             All Done                                                     │
  818. │                                                                          │
  819. │        Carry = 1                                                         │
  820. │             Can't deallocate selector                                    │
  821. │                                                                          │
  822. │Other Registers Change :  EAX,EBX                                         │
  823. │                                                                          │
  824. │                                                                          │
  825. └──────────────────────────────────────────────────────────────────────────┘
  826.  
  827. Exemple :
  828.             mov ah,DeAllocate_Selector
  829.             mov bx,[_0a0000h_Sel]
  830.             Int_EOS
  831.             jc Invalid_Selector
  832.  
  833.  
  834. ┌──────────────────────────────────────────────────────────────────────────┐
  835. │Physical Address Mapping           Allocate memory mapping                │
  836. │                                                                          │
  837. │In :                                                                      │
  838. │        AH = Physical_Address_Mapping                                     │
  839. │       ECX = Size Of region                                               │
  840. │       ESI = Physical address of memory                                   │
  841. │                                                                          │
  842. │Out :                                                                     │
  843. │        Carry = 0                                                         │
  844. │       ESI = Linear Address of the region                                 │
  845. │             All Done                                                     │
  846. │                                                                          │
  847. │        Carry = 1                                                         │
  848. │             No Room free                                                 │
  849. │                                                                          │
  850. │Other Registers Change : None                                             │
  851. │                                                                          │
  852. │                                                                          │
  853. └──────────────────────────────────────────────────────────────────────────┘
  854.  
  855. Exemple :
  856.             mov ah,Physical_Address_Mapping
  857.             mov ecx,1024*1024
  858.             mov esi,[Vesa_Linear_Address]
  859.             Int_EOS
  860.             jc Not_Enough_Memory
  861. EndIf
  862.  
  863.  
  864. ┌──────────────────────────────────────────────────────────────────────────┐
  865. │Free Physical Address Mapping      Free the allocate memory mapping       │
  866. │                                                                          │
  867. │In :                                                                      │
  868. │        AH = Free_Address_Mapping                                         │
  869. │       ESI = Address of the block to free                                 │
  870. │                                                                          │
  871. │Out :                                                                     │
  872. │        Carry = 0                                                         │
  873. │             All Done                                                     │
  874. │                                                                          │
  875. │        Carry = 1                                                         │
  876. │             Invalid address                                              │
  877. │                                                                          │
  878. │Other Registers Change : None                                             │
  879. │                                                                          │
  880. │                                                                          │
  881. └──────────────────────────────────────────────────────────────────────────┘
  882.  
  883. Exemple :
  884.             mov ah,Free_Physical_Address_Mapping
  885.             mov esi,[Vesa_Linear_Address]
  886.             Int_EOS
  887.             jc Invalid_Address
  888.  
  889.  
  890. ╔══════════════════════════════════════════════════════════════════════════╗
  891. ║                                                                          ║
  892. ║ La gestion de fichiers                                                   ║
  893. ║                                                                          ║
  894. ╚══════════════════════════════════════════════════════════════════════════╝
  895.  
  896. Charger un fichier en mémoire n'est guère plus compliqué.
  897.  
  898.         Chargement d'un fichier externe :
  899.  
  900.                 mov ah,Load_External_File
  901.                 mov edx,offset File_name
  902.                 Int_EOS
  903.                 jc Error_File
  904.                 mov File_Buffer,eax
  905.  
  906.  
  907.         Chargement d'un fichier linké avec LightLink (Linker fournit avec
  908.         l'E.O.S) :
  909.  
  910.                 mov ah,Load_Internal_File
  911.                 mov edx,offset File_name
  912.                 Int_EOS
  913.                 mov File_Buffer,eax
  914.  
  915.  
  916.         Restitution de la dernière allocation :
  917.  
  918.                 mov ah,DeAllocate_Memory
  919.                 Int_EOS
  920.  
  921.  
  922.         Chargement d'un fichier externe avec un handle:
  923.  
  924.                 mov ah,Load_External_File_Handle
  925.                 mov edx,offset File_name
  926.                 Int_EOS
  927.                 jc Error_File
  928.                 mov File_Buffer,eax
  929.                 mov Memory_Handle,edi
  930.  
  931.  
  932.         Restitution par handle :
  933.  
  934.                 mov ah,DeAllocate_Memory_Handle
  935.                 mov edi,[Memory_Handle]
  936.                 Int_EOS
  937.                 jc Invalid_Handle
  938.  
  939.  
  940. La fonction Load_Internal_File fonctionne aussi si le programme n'est pas
  941. linké. L'E.O.S est capable de distinguer les deux cas ce qui permet de
  942. développer et tester un programme sans avoir à linker les données.
  943. De plus, si votre fichier est compacté avec un format de type LZ comme
  944. Diet 1.44 l'E.O.S le décompresse automatiquement !
  945.  
  946.         Il est aussi possible de faire l'opération inverse :
  947.  
  948.                 mov ah,Write_External_File
  949.                 mov edx,O File_name
  950.                 mov esi,[Buffer]
  951.                 mov ecx,[Size_Buffer]
  952.                 Int_EOS
  953.                 jc Error_File
  954.  
  955.  
  956. ╔══════════════════════════════════════════════════════════════════════════╗
  957. ║                                                                          ║
  958. ║ Les fonctions pour la gestion de fichiers                                ║
  959. ║                                                                          ║
  960. ╚══════════════════════════════════════════════════════════════════════════╝
  961.  
  962. ┌─────────────────────────┐
  963. │Load Internal File       │
  964. │Load External File       │
  965. │Load Internal File Handle│
  966. │Load External File Handle│
  967. │Write External File      │
  968. └─────────────────────────┘
  969.  
  970. ┌──────────────────────────────────────────────────────────────────────────┐
  971. │Load Internal file   Load a file which is link with LLINK                 │
  972. │                     if the file is not present the program stop and      │
  973. │                     display a error message                              │
  974. │                                                                          │
  975. │In :                                                                      │
  976. │        AH = Load_Internal_File                                           │
  977. │       EDX = Offset of file name                                          │
  978. │                                                                          │
  979. │Out :                                                                     │
  980. │       EAX = Logical address of buffer (work with Data32_Sel)             │
  981. │       ECX = Number of bytes read                                         │
  982. │       ESI = Physical address of buffer (work with Flat_Data_Sel)         │
  983. │                                                                          │
  984. │Other Registers Change : None                                             │
  985. │                                                                          │
  986. │                                                                          │
  987. └──────────────────────────────────────────────────────────────────────────┘
  988.  
  989. Exemple :
  990.             mov ah,Load_Internal_File
  991.             mov edx,O File_name
  992.             Int_EOS
  993.             mov [File_Buffer],eax
  994.  
  995.  
  996. ┌──────────────────────────────────────────────────────────────────────────┐
  997. │Load External file   Load a external file and uncompress it if it has     │
  998. │                     been compress with Diet 1.44                         │
  999. │                                                                          │
  1000. │In :                                                                      │
  1001. │        AH = Load_External_File                                           │
  1002. │       EDX = Offset of file name                                          │
  1003. │                                                                          │
  1004. │Out :                                                                     │
  1005. │       Carry = 0                                                          │
  1006. │        All done                                                          │
  1007. │       EAX = Logical address of buffer (work with Data32_Sel)             │
  1008. │       ECX = Number of bytes read                                         │
  1009. │       ESI = Physical address of buffer (work with Flat_Data_Sel)         │
  1010. │                                                                          │
  1011. │                                                                          │
  1012. │       Carry = 1                                                          │
  1013. │        Error                                                             │
  1014. │       EAX = 1 File Not Found                                             │
  1015. │             2 Not Enough Memory                                          │
  1016. │                                                                          │
  1017. │Other Registers Change : None                                             │
  1018. │                                                                          │
  1019. │                                                                          │
  1020. └──────────────────────────────────────────────────────────────────────────┘
  1021.  
  1022. Exemple :
  1023.             mov ah,Load_External_File
  1024.             mov edx,O File_name
  1025.             Int_EOS
  1026.             jc Error_File
  1027.             mov [File_Buffer],eax
  1028.  
  1029.  
  1030. ┌──────────────────────────────────────────────────────────────────────────┐
  1031. │Load Internal File Handle  Load a file which is link with LLINK           │
  1032. │                           if the file is not present the program stop    │
  1033. │                           and display a error message                    │
  1034. │                                                                          │
  1035. │In :                                                                      │
  1036. │        AH = Load_Internal_File_Handle                                    │
  1037. │       EDX = Offset of file name                                          │
  1038. │                                                                          │
  1039. │Out :                                                                     │
  1040. │       EAX = Logical address of buffer (work with Data32_Sel)             │
  1041. │       ECX = Number of bytes read                                         │
  1042. │       ESI = Physical address of buffer (work with Flat_Data_Sel)         │
  1043. │       EDI = Handle of Memory                                             │
  1044. │                                                                          │
  1045. │Other Registers Change : None                                             │
  1046. │                                                                          │
  1047. │                                                                          │
  1048. └──────────────────────────────────────────────────────────────────────────┘
  1049.  
  1050. Exemple :
  1051.             mov ah,Load_Internal_File_Handle
  1052.             mov edx,O File_name
  1053.             Int_EOS
  1054.             mov [File_Buffer],eax
  1055.             mov [Memory_Handle],edi
  1056.  
  1057.  
  1058. ┌──────────────────────────────────────────────────────────────────────────┐
  1059. │Load External File Handle  Load a external file and uncompress it if it   │
  1060. │                           has been compress with Diet 1.44               │
  1061. │                                                                          │
  1062. │In :                                                                      │
  1063. │        AH = Load_External_File_Handle                                    │
  1064. │       EDX = Offset of file name                                          │
  1065. │                                                                          │
  1066. │Out :                                                                     │
  1067. │       Carry = 0                                                          │
  1068. │        All done                                                          │
  1069. │       EAX = Logical address of buffer (work with Data32_Sel)             │
  1070. │       ECX = Number of bytes read                                         │
  1071. │       ESI = Physical address of buffer (work with Flat_Data_Sel)         │
  1072. │       EDI = Handle of Memory                                             │
  1073. │                                                                          │
  1074. │                                                                          │
  1075. │       Carry = 1                                                          │
  1076. │        Error                                                             │
  1077. │       EAX = 1 File Not Found                                             │
  1078. │             2 Not Enough Memory                                          │
  1079. │                                                                          │
  1080. │Other Registers Change : None                                             │
  1081. │                                                                          │
  1082. │                                                                          │
  1083. └──────────────────────────────────────────────────────────────────────────┘
  1084.  
  1085. Exemple :
  1086.             mov ah,Load_External_File_Handle
  1087.             mov edx,O File_name
  1088.             Int_EOS
  1089.             jc Error_File
  1090.             mov [File_Buffer],eax
  1091.             mov [Memory_Handle],edi
  1092.  
  1093.  
  1094. ┌──────────────────────────────────────────────────────────────────────────┐
  1095. │Write External File  Save a File on a Disk                                │
  1096. │                                                                          │
  1097. │Entree :                                                                  │
  1098. │        AH = Write_External_File                                          │
  1099. │       ECX = Size Of File                                                 │
  1100. │       EDX = Offset of file name                                          │
  1101. │       ESI = Buffer address                                               │
  1102. │                                                                          │
  1103. │Sortie :                                                                  │
  1104. │       Carry = 0                                                          │
  1105. │        Tout Va Bien                                                      │
  1106. │                                                                          │
  1107. │       Carry = 1                                                          │
  1108. │        Erreur  Can't write file                                          │
  1109. │                                                                          │
  1110. │Other Registers Change : None                                             │
  1111. │                                                                          │
  1112. │                                                                          │
  1113. └──────────────────────────────────────────────────────────────────────────┘
  1114.  
  1115. Exemple :
  1116.             mov ah,Write_External_File
  1117.             mov edx,O File_name
  1118.             mov esi,[Buffer]
  1119.             mov ecx,[Size_Buffer]
  1120.             Int_EOS
  1121.             jc Error_File
  1122.  
  1123.  
  1124. ╔══════════════════════════════════════════════════════════════════════════╗
  1125. ║                                                                          ║
  1126. ║ La gestion des cartes sonores                                            ║
  1127. ║                                                                          ║
  1128. ╚══════════════════════════════════════════════════════════════════════════╝
  1129.  
  1130. La gestion des cartes sonores n'a pas été oubliée.
  1131.  
  1132. L'E.O.S est en effet capable de jouer un sample ou un module Amiga (de 2 à 32
  1133. voix) sans la moindre programmation de votre part sur les neuf cartes
  1134. suivantes :
  1135.  
  1136.         ■ Sound Blaster
  1137.         ■ Sound Blaster Pro
  1138.         ■ Sound Blaster 16 Asp
  1139.         ■ Sound Blaster AW32
  1140.         ■ Gravis Ultrasound
  1141.         ■ Gravis Ultrasound Max
  1142.         ■ Gravis Ultrasound Ace
  1143.         ■ Gravis Ultrasound Pnp
  1144.         ■ Windows Sound System
  1145.  
  1146. Pour une qualité de mixage optimale, l'E.O.S choisit automatiquement le
  1147. mixage adapté à la carte sonore détectée (8bits pour la SB pro, 16 bits pour
  1148. la Sb 16, etc...).
  1149.  
  1150. Attention : La détection est réalisée à l'aide de la variable d'environnement
  1151. (Blaster ou Ultrasnd). Si cette variable n'est pas correctement renseignée
  1152. aucune carte sonore ne sera détectée.
  1153.  
  1154.  
  1155.         Exemple :
  1156.  
  1157.                 mov ah,Detect_Sound_Card
  1158.                 xor bx,bx
  1159.                 mov cx,1
  1160.                 Int_EOS
  1161.  
  1162.                 Vous n'êtes pas obligé d'utiliser la détection automatique :
  1163.  
  1164.                 mov ah,Manual_Setup
  1165.                 mov al,Gravis
  1166.                 mov bx,220h
  1167.                 mov cl,7
  1168.                 mov ch,7
  1169.                 mov dl,1
  1170.                 mov dh,1
  1171.                 Int_EOS
  1172.  
  1173.                 Après avoir détecter une carte il faut charger un fichier de
  1174.                 musique en mémoire :
  1175.  
  1176.                 mov ah,Load_Module
  1177.                 mov al,4
  1178.                 mov ebx,22000
  1179.                 mov edx,offset Module_name
  1180.                 xor ecx,ecx
  1181.                 Int_EOS
  1182.                 jc error_file
  1183.  
  1184.                 Pour finir il faut lancer la musique :
  1185.  
  1186.                 mov ah,Play_Module
  1187.                 Int_EOS
  1188.  
  1189.                 Plusieurs fonctions sont alors disponibles :
  1190.  
  1191.                         Set Volume   Pour changer le volume de la musique
  1192.                         Play Sample  Pour jouer un sample
  1193.                         Get Info     Pour obtenir des infos sur la musique
  1194.                                      (synchronisation par exemple)
  1195.                         Set Pattern  Pour changer de position dans un module
  1196.  
  1197.                 call Pause
  1198.  
  1199.                 mov ax,4c00h
  1200.                 int 21h
  1201.  
  1202. Comme vous le voyez ci-dessus, vous n'êtes pas obligé d'arrêter la musique
  1203. ou de libérer la mémoire avant de quitter votre programme. C'est l'E.O.S qui
  1204. s'en charge. A chaque fois qu'il rencontre la fonction 4c00h ou lors
  1205. d'un plantage programme, l'E.O.S restitue automatiquement
  1206. l'environnement de départ :
  1207.  
  1208.         ■ Le mode vidéo y compris les modes VESA (132x60,etc...)
  1209.         ■ L'heure de l'horloge.
  1210.         ■ Les interruptions.
  1211.         ■ La mémoire allouée.
  1212.         ■ Stoppe la musique.
  1213.  
  1214. Bien entendu, il est toujours possible de libérer la mémoire et d'arrêter
  1215. un module pour en charger un autre comme ci-dessous:
  1216.  
  1217.                 mov ah,Stop_Module
  1218.                 Int_EOS
  1219.  
  1220.                 mov ah,Clear_Module
  1221.                 Int_EOS
  1222.  
  1223.  
  1224. ╔══════════════════════════════════════════════════════════════════════════╗
  1225. ║                                                                          ║
  1226. ║ Comment accéder aux différentes variables d'un module                    ║
  1227. ║                                                                          ║
  1228. ╚══════════════════════════════════════════════════════════════════════════╝
  1229.  
  1230. Pour accéder aux informations d'un module, vous pouvez utiliser la fonction
  1231. Get_Info ou accéder directement aux variables ci-dessous :
  1232.  
  1233. Sound_Card_Type                 : Byte
  1234. Sound_Card_Port                 : Word
  1235. Sound_Card_Irq                  : Byte
  1236. Sound_Card_Dma                  : Byte
  1237. Master_Volume                   : Byte
  1238. Master_Volume_Sfx               : Byte
  1239. Current_Pattern                 : Byte
  1240. Current_Note                    : Byte
  1241. Current_Speed                   : Byte
  1242. Current_BPM                     : Byte
  1243. Index_Pattern_Order             : Dword
  1244. Pattern_Order                   : Byte
  1245. Number_Channel                  : Dword
  1246. Diamond_Channel                 : MS
  1247.  
  1248. MS                              struc
  1249.         Current_Sample          dd      0
  1250.         Porta                   dw      ?
  1251.         Tremelo                 db      ?
  1252.         Current_Position        dd      ?
  1253.         Current_Low_Position    dd      ?
  1254.         Jump_0e6                db      ?
  1255.         Compt_jump_0e6          db      ?
  1256.         Flags_0e6               db      ?
  1257.         Porta_Freq              dw      ?
  1258.         Porta_To                dw      ?
  1259.         Vibrato                 db      ?
  1260.         Vibrato_Flag            db      ?
  1261.         FineTune                dw      ?
  1262.         Last_Effect             dd      0
  1263.         Voice                   db      ?
  1264.         Sample_volume           db      ?
  1265.         Base_Sample_Volume      db      ?
  1266.         Mute                    db      ?
  1267.         Frequence               dw      ?
  1268.         Compt_Frequence         dd      ?
  1269.         New_sample              db      ?
  1270.         Arp                     dw      ?,?,?
  1271.         Arp_Counter             dw      ?
  1272.         Slide_volume            dw      ?
  1273.         Panning                 db      ?
  1274.         Retrig_Note             db      ?
  1275.         Retrig_Note_Val         db      ?
  1276.         Cut_Note                db      ?
  1277.         Delay_Note              db      ?
  1278.                                 db      0
  1279.         Delay_Note_Offset       dd      ?
  1280.         Addr_Read_Again         dd      ?
  1281. MS                              ends
  1282.  
  1283.  
  1284. Exemple :
  1285.  
  1286.             mov [Master_Volume],32      ; Set Music Volume
  1287.             mov [Master_Volume_Sfx],63  ; Set Sample Volume
  1288.  
  1289.  
  1290. ╔══════════════════════════════════════════════════════════════════════════╗
  1291. ║                                                                          ║
  1292. ║ Absence de carte sonore                                                  ║
  1293. ║                                                                          ║
  1294. ╚══════════════════════════════════════════════════════════════════════════╝
  1295.  
  1296. L'E.O.S permet de jouer un module même en cas d'absence de carte
  1297. sonore. De ce fait, si certains évenements sont synchronisés par rapport à
  1298. la musique aucunes modifications n'est a apporter pour les machines sans
  1299. carte sonore.
  1300.  
  1301.  
  1302. ╔══════════════════════════════════════════════════════════════════════════╗
  1303. ║                                                                          ║
  1304. ║ Les déclarations du player de module                                     ║
  1305. ║                                                                          ║
  1306. ╚══════════════════════════════════════════════════════════════════════════╝
  1307.  
  1308.   No_Card    = 0
  1309.   Sb_10      = 01h
  1310.   Sb_15      = 02h
  1311.   Sb_20      = 03h
  1312.   Sb_Pro     = 04h
  1313.   Sb_16      = 05h
  1314.   Sb_Awe     = 06h
  1315.   Gravis     = 10h
  1316.   Gravis_Max = 11h
  1317.   Gravis_Ace = 12h
  1318.   Gravis_Pnp = 13h
  1319.   WSS        = 20h
  1320.  
  1321.  
  1322. ╔══════════════════════════════════════════════════════════════════════════╗
  1323. ║                                                                          ║
  1324. ║ Les effets sonores                                                       ║
  1325. ║                                                                          ║
  1326. ╚══════════════════════════════════════════════════════════════════════════╝
  1327.  
  1328. L'E.O.S est en mesure de jouer des samples indépendamment de la musique.
  1329. Pour cela il faut déclarer des pistes fictives lorsque l'on charge un module
  1330. en mémoire :
  1331.  
  1332. Exemple :
  1333.             mov ah,Load_Module
  1334.             mov al,4+1
  1335.             mov bx,22000
  1336.             mov ecx,1               ; Nombre de pistes pour les effets sonores
  1337.             mov edx,O Module_Name
  1338.             Int_EOS
  1339.             jc Error_Loading_Module
  1340.  
  1341.  
  1342. On peut ensuite jouer un sample à l'instant voulu très facilement :
  1343.  
  1344.             mov ah,Play_Sample
  1345.             mov cx,339              ; Freq.
  1346.             mov dx,00               ; Piste 1
  1347.             mov bx,09h              ; Sample number
  1348.             Int_EOS
  1349.  
  1350.  
  1351. ╔══════════════════════════════════════════════════════════════════════════╗
  1352. ║                                                                          ║
  1353. ║ Les fonctions pour jouer une musique ou des effets sonores               ║
  1354. ║                                                                          ║
  1355. ╚══════════════════════════════════════════════════════════════════════════╝
  1356.  
  1357. ┌─────────────────┐
  1358. │Detect Sound Card│
  1359. │Manual Setup     │
  1360. │Load Module      │
  1361. │Play Module      │
  1362. │Stop Module      │
  1363. │Clear Module     │
  1364. │Set Volume       │
  1365. │Play Sample      │
  1366. │Get Info         │
  1367. │Set Pattern      │
  1368. └─────────────────┘
  1369.  
  1370. ┌──────────────────────────────────────────────────────────────────────────┐
  1371. │Detect Sound Card   Detect with the environment variable the sound        │
  1372. │                    card installed                                        │
  1373. │                                                                          │
  1374. │In :                                                                      │
  1375. │        AH = Detect_Sound_Card                                            │
  1376. │        CX = 1  Display result of Searching                               │
  1377. │                                                                          │
  1378. │Out :                                                                     │
  1379. │        AX = 0  No_Card                                                   │
  1380. │           = 1  Sound Blaster 1.0                                         │
  1381. │           = 2  Sound Blaster 1.5                                         │
  1382. │           = 3  Sound Blaster 2.0                                         │
  1383. │           = 4  Sound Blaster Pro                                         │
  1384. │           = 5  Sound Blaster 16                                          │
  1385. │           = 6  Sound Blaster Awe 32                                      │
  1386. │           = 10h  Gus                                                     │
  1387. │           = 11h  Gus Max                                                 │
  1388. │           = 12h  Gus Ace                                                 │
  1389. │           = 13h  Gus Pnp                                                 │
  1390. │           = 20h  Windows Sound System                                    │
  1391. │        BX = Port                                                         │
  1392. │        CX = Irq                                                          │
  1393. │        DX = Dma                                                          │
  1394. │        SI = Dsp Version (For Sb) ou                                      │
  1395. │             Size of RAM of the Gravis                                    │
  1396. │                                                                          │
  1397. │Other Registers Change : None                                             │
  1398. │                                                                          │
  1399. │                                                                          │
  1400. └──────────────────────────────────────────────────────────────────────────┘
  1401.  
  1402. Exemple :
  1403.             mov ah,Detect_Sound_Card
  1404.             mov cx,1
  1405.             Int_EOS
  1406.  
  1407.  
  1408. ┌──────────────────────────────────────────────────────────────────────────┐
  1409. │Manual Setup                                                              │
  1410. │                                                                          │
  1411. │In :                                                                      │
  1412. │        AH = Manual_Setup                                                 │
  1413. │        AL = Type                                                         │
  1414. │        BX = Port                                                         │
  1415. │        CL = Irq1                                                         │
  1416. │        CH = Irq2      ; Irq Gus 2                                        │
  1417. │        DL = Dma1      ; Dma Gus 1 or Dma 8 Bits for SB                   │
  1418. │        DH = Dma2      ; Dma Gus 2 or Dma 16 Bits for SB                  │
  1419. │                                                                          │
  1420. │Out :                                                                     │
  1421. │        Carry Off                                                         │
  1422. │        Init Ok                                                           │
  1423. │                                                                          │
  1424. │        Carry On                                                          │
  1425. │        No Sound Card Found                                               │
  1426. │                                                                          │
  1427. └──────────────────────────────────────────────────────────────────────────┘
  1428. Manual_Setup        = 37h
  1429. If Impossible
  1430.             mov ah,Manual_Setup
  1431.             mov al,Gravis
  1432.             mov bx,220h
  1433.             mov cl,7
  1434.             mov ch,7
  1435.             mov dl,1
  1436.             mov dh,1
  1437.             Int_EOS
  1438.             ...
  1439.             mov ah,Manual_Setup
  1440.             mov al,Sb_16
  1441.             mov bx,220h
  1442.             mov cl,7
  1443.             mov dl,1
  1444.             mov dh,5
  1445.             Int_EOS
  1446. EndIf
  1447.  
  1448.  
  1449. ┌──────────────────────────────────────────────────────────────────────────┐
  1450. │Load Module   Load a module & initialize into the memory                  │
  1451. │                                                                          │
  1452. │In :                                                                      │
  1453. │        AH = Load_Module                                                  │
  1454. │        AL = Bit 0 = 1  Load a internal module (can be compress and link  │
  1455. │                        with LLINK)                                       │
  1456. │           = Bit 1 = 1  Load module  from memory                          │
  1457. │           = Bit 2 = 1  Force old mod Loading (15 instr)                  │
  1458. │        BX = Replay rate (16000 to 44100 Hz)                              │
  1459. │        CX = Number of Sfx Channel                                        │
  1460. │        DS:EDX = Offset of Module name or                                 │
  1461. │                 Offset into the memory of the beginning of the module    │
  1462. │                                                                          │
  1463. │Out :                                                                     │
  1464. │        Carry = 0                                                         │
  1465. │             All Done                                                     │
  1466. │                                                                          │
  1467. │        Carry = 1                                                         │
  1468. │             Can't Load Module                                            │
  1469. │                                                                          │
  1470. │Other Registers Change : None                                             │
  1471. │                                                                          │
  1472. │                                                                          │
  1473. └──────────────────────────────────────────────────────────────────────────┘
  1474.  
  1475. Exemple :
  1476.             mov ah,Load_Module
  1477.             mov al,4+1
  1478.             mov bx,22000
  1479.             xor ecx,ecx
  1480.             mov edx,O Module_Name
  1481.             Int_EOS
  1482.             jc Error_Loading_Module
  1483.  
  1484.  
  1485. ┌──────────────────────────────────────────────────────────────────────────┐
  1486. │Play Module   Start playing the module                                    │
  1487. │                                                                          │
  1488. │In :                                                                      │
  1489. │        AH = Play_Module                                                  │
  1490. │                                                                          │
  1491. │Out :                                                                     │
  1492. │        Carry = 0                                                         │
  1493. │             All Done                                                     │
  1494. │                                                                          │
  1495. │        Carry = 1                                                         │
  1496. │             Can't Play Module                                            │
  1497. │                                                                          │
  1498. │Other Registers Change : None                                             │
  1499. │                                                                          │
  1500. │                                                                          │
  1501. └──────────────────────────────────────────────────────────────────────────┘
  1502.  
  1503. Exemple :
  1504.             mov ah,Play_Module
  1505.             Int_EOS
  1506.  
  1507.  
  1508. ┌──────────────────────────────────────────────────────────────────────────┐
  1509. │Stop Module   Stop playing module                                         │
  1510. │                                                                          │
  1511. │In :                                                                      │
  1512. │        AH = Stop_Module                                                  │
  1513. │                                                                          │
  1514. │Out :                                                                     │
  1515. │                                                                          │
  1516. │Other Registers Change : None                                             │
  1517. │                                                                          │
  1518. │                                                                          │
  1519. └──────────────────────────────────────────────────────────────────────────┘
  1520.  
  1521. Exemple :
  1522.             mov ah,Stop_Module
  1523.             Int_EOS
  1524.  
  1525.  
  1526. ┌──────────────────────────────────────────────────────────────────────────┐
  1527. │Clear Module   Unload the module from memory                              │
  1528. │                                                                          │
  1529. │In :                                                                      │
  1530. │        AH = Clear_Module                                                 │
  1531. │                                                                          │
  1532. │Out :                                                                     │
  1533. │                                                                          │
  1534. │Other Registers Change : None                                             │
  1535. │                                                                          │
  1536. │                                                                          │
  1537. └──────────────────────────────────────────────────────────────────────────┘
  1538.  
  1539. Exemple :
  1540.             mov ah,Clear_Module
  1541.             Int_EOS
  1542.  
  1543.  
  1544. ┌──────────────────────────────────────────────────────────────────────────┐
  1545. │Set Volume   Set the master volume of the module                          │
  1546. │                                                                          │
  1547. │In :                                                                      │
  1548. │        AH = Set_Volume                                                   │
  1549. │        CL = Volume (0 to 63)                                             │
  1550. │        DL = Sfx Volume (0 to 63)                                         │
  1551. │                                                                          │
  1552. │Out :                                                                     │
  1553. │                                                                          │
  1554. │Other Registers Change : None                                             │
  1555. │                                                                          │
  1556. │                                                                          │
  1557. └──────────────────────────────────────────────────────────────────────────┘
  1558.  
  1559. Exemple :
  1560.             mov ah,Set_Volume
  1561.             mov cl,[New_Volume]
  1562.             mov dl,[New_Volume_Sfx]
  1563.             Int_EOS
  1564.  
  1565.  
  1566. ┌──────────────────────────────────────────────────────────────────────────┐
  1567. │Play Sample   Play a sample include into the module                       │
  1568. │                                                                          │
  1569. │In :                                                                      │
  1570. │        AH = Play_Sample                                                  │
  1571. │        BX = Sample numbers                                               │
  1572. │        CX = Sample Frequency                                             │
  1573. │        DX = voice of sample                                              │
  1574. │                                                                          │
  1575. │Out :                                                                     │
  1576. │                                                                          │
  1577. │Other Registers Change : None                                             │
  1578. │                                                                          │
  1579. │                                                                          │
  1580. └──────────────────────────────────────────────────────────────────────────┘
  1581.  
  1582. Exemple :
  1583.             mov ah,Play_Sample
  1584.             mov bx,10
  1585.             mov cx,15fh
  1586.             mov dx,4
  1587.             Int_EOS
  1588.  
  1589.  
  1590. ┌──────────────────────────────────────────────────────────────────────────┐
  1591. │Get Info   Get information about the module when playing                  │
  1592. │                                                                          │
  1593. │In:                                                                       │
  1594. │        AH = Get_Info                                                     │
  1595. │                                                                          │
  1596. │Out:                                                                      │
  1597. │        AH = Position                                                     │
  1598. │        AL = Pattern                                                      │
  1599. │        BX = Note                                                         │
  1600. │        CL = Master Volume                                                │
  1601. │        DL = Master Volume Sfx                                            │
  1602. │                                                                          │
  1603. │                                                                          │
  1604. │Other Registers Change : None                                             │
  1605. │                                                                          │
  1606. │                                                                          │
  1607. └──────────────────────────────────────────────────────────────────────────┘
  1608.  
  1609. Exemple :
  1610.             mov ah,Get_Info
  1611.             Int_EOS
  1612.  
  1613.  
  1614. ┌──────────────────────────────────────────────────────────────────────────┐
  1615. │Set Pattern  Set the current position of the playing module               │
  1616. │                                                                          │
  1617. │In:                                                                       │
  1618. │        AH = Set_Pattern                                                  │
  1619. │        BX = New_Position                                                 │
  1620. │        CX = New_Note                                                     │
  1621. │                                                                          │
  1622. │Out:                                                                      │
  1623. │                                                                          │
  1624. │Other Registers Change : None                                             │
  1625. │                                                                          │
  1626. │                                                                          │
  1627. └──────────────────────────────────────────────────────────────────────────┘
  1628.  
  1629. Exemple :
  1630.             mov ah,Set_Pattern
  1631.             mov bx,[New_Position]
  1632.             mov cx,[New_Note]
  1633.             Int_EOS
  1634.  
  1635.  
  1636. ╔══════════════════════════════════════════════════════════════════════════╗
  1637. ║                                                                          ║
  1638. ║ Gestion d'un second écran monochrome                                     ║
  1639. ║                                                                          ║
  1640. ╚══════════════════════════════════════════════════════════════════════════╝
  1641.  
  1642. Pour faciliter le debuggage de vos programmes, l'E.O.S fournit des
  1643. fonctions qui permettent de controler un deuxième écran via une carte
  1644. monochrome de type Hercule.
  1645.  
  1646. L'E.O.S détecte automatiquement votre écran. Cependant, si celui-ci n'était
  1647. pas reconnu, vous pouvez utiliser la séquence suivante :
  1648.  
  1649.                 mov ah,Set_Mono
  1650.                 mov bx,On
  1651.                 Int_EOS
  1652.  
  1653. Deux fonctions sont alors disponibles : l'affichage d'une chaîne de
  1654. caractère ASCII et l'affichage d'une valeur Hexadécimal.
  1655.  
  1656.         Afficher une Chaîne ASCII :
  1657.  
  1658.                 mov ah,Set_String_Mono
  1659.                 mov bx,Coordonee X
  1660.                 mov cx,Coordonee Y
  1661.                 mov edx,Offset Chaine_A_Afficher
  1662.                 Int_EOS
  1663.  
  1664.         Afficher une Valeur Hexadécimal :
  1665.  
  1666.                 mov ah,Set_Value_Mono
  1667.                 mov bx,Coordonee X
  1668.                 mov cx,Coordonee Y
  1669.                 mov edx,Valeur_A_Afficher
  1670.                 Int_EOS
  1671.  
  1672. Une macro est également disponible : Send qui permet une utilisation
  1673. plus simple de la fonction Set_Value_Mono
  1674.  
  1675.         Afficher une Valeur sur l'écran monochrome :
  1676.  
  1677.                 Send Valeur_A_Afficher,X,Y
  1678.  
  1679. La chaîne ASCII peut se terminer soit par $ soit par le caractère NULL.
  1680. La fonction prend aussi en compte les caractères retour chariot (13 et 10).
  1681. Les valeurs en hexadécimal ne doivent pas dépasser 32 Bits.
  1682.  
  1683. Attention : Pour un gain de temps aucun test n'est effectué au niveau des
  1684.             coordonnées de l'écran.
  1685.  
  1686. Note : L'écran Monochrome est automatiquement effacé au début et a la fin d'un
  1687.        programme.
  1688.  
  1689.  
  1690. ╔══════════════════════════════════════════════════════════════════════════╗
  1691. ║                                                                          ║
  1692. ║ Les fonctions pour utiliser un second écran pour le debuggage            ║
  1693. ║                                                                          ║
  1694. ╚══════════════════════════════════════════════════════════════════════════╝
  1695.  
  1696. ┌───────────────┐
  1697. │Set Mono       │
  1698. │Set String Mono│
  1699. │Set Value Mono │
  1700. └───────────────┘
  1701.  
  1702. ┌──────────────────────────────────────────────────────────────────────────┐
  1703. │Set Mono   Force On/Off the display of all the Monochrome Function        │
  1704. │                                                                          │
  1705. │In :                                                                      │
  1706. │        AH = Set_Mono                                                     │
  1707. │        BX = On  Force Monochrome Off                                     │
  1708. │             Off Force Monochrome On                                      │
  1709. │                                                                          │
  1710. │Out :                                                                     │
  1711. │                                                                          │
  1712. │Other Registers Change : None                                             │
  1713. │                                                                          │
  1714. │                                                                          │
  1715. └──────────────────────────────────────────────────────────────────────────┘
  1716.  
  1717. Exemple :
  1718.             mov ah,Set_Mono
  1719.             mov bx,On
  1720.             Int_EOS
  1721.  
  1722.  
  1723. ┌──────────────────────────────────────────────────────────────────────────┐
  1724. │Set String Mono   Display a string on the Monochrome adapter              │
  1725. │                                                                          │
  1726. │In :                                                                      │
  1727. │        AH = Set_String_Mono                                              │
  1728. │        BX = Coordonate  X                                                │
  1729. │        CX = Coordonate  Y                                                │
  1730. │       EDX = Address of text ending by $                                  │
  1731. │                                                                          │
  1732. │                                                                          │
  1733. │Out :                                                                     │
  1734. │                                                                          │
  1735. │Other Registers Change : None                                             │
  1736. │                                                                          │
  1737. │                                                                          │
  1738. └──────────────────────────────────────────────────────────────────────────┘
  1739.  
  1740. Exemple :
  1741.             mov ah,Set_String_Mono
  1742.             mov bx,1
  1743.             mov cx,10
  1744.             mov edx,offset text_mono
  1745.             Int_EOS
  1746.  
  1747.  
  1748. ┌──────────────────────────────────────────────────────────────────────────┐
  1749. │Set Value Mono   Display A Word in Hexadécimal on the Monochrome adapter  │
  1750. │                                                                          │
  1751. │In :                                                                      │
  1752. │        AH = Set_Value_Mono                                               │
  1753. │        BX = Coordonate X                                                 │
  1754. │        CX = Coordonate Y                                                 │
  1755. │        EDX = Value to be display                                         │
  1756. │                                                                          │
  1757. │                                                                          │
  1758. │Out :                                                                     │
  1759. │                                                                          │
  1760. │Other Registers Change : None                                             │
  1761. │                                                                          │
  1762. │                                                                          │
  1763. └──────────────────────────────────────────────────────────────────────────┘
  1764.  
  1765. Exemple :
  1766.             mov ah,Set_Value_Mono
  1767.             mov bx,1
  1768.             mov cx,10
  1769.             mov dx,1234h
  1770.             Int_EOS
  1771.  
  1772.  
  1773. ╔══════════════════════════════════════════════════════════════════════════╗
  1774. ║                                                                          ║
  1775. ║ Le clavier                                                               ║
  1776. ║                                                                          ║
  1777. ╚══════════════════════════════════════════════════════════════════════════╝
  1778.  
  1779. Une gestion clavier très simple à été implantée dans l'E.O.S afin de vous
  1780. faciliter la vie. Pour l'activer il faut prendre le contrôle de l'interruption
  1781. 09 comme ci-dessous :
  1782.  
  1783.         Activation du gestionnaire de clavier
  1784.  
  1785.                 mov ah,Use_Int_09
  1786.                 mov bx,On
  1787.                 Int_EOS
  1788.  
  1789. Le clavier est alors entièrement gérer par l'E.O.S qui dialogue directement
  1790. avec lui. Il n'y a plus aucun appel vers les anciens gestionnaires du
  1791. DOS. L'interruption 16h ne fonctionne donc plus.
  1792.  
  1793. La lecture du clavier devient alors très facile grâce à la variable Key_Map.
  1794. Cette variable est en réalité un tableau de 128 octets qui correspond
  1795. au 128 scancodes renvoyés par le clavier.
  1796. Pour connaître l'état d'une touche il suffit de savoir si sont scancode et
  1797. à 0 ou 1 (On ou Off).
  1798.  
  1799.         Exemple, pour tester si la touche Escape est actuellement enfoncée :
  1800.  
  1801.                 cmp Key_Map[Escape],On
  1802.                 je Touche_Escape_Enfoncé
  1803.  
  1804.                 ...
  1805.  
  1806.         Touche_Escape_Enfoncé:
  1807.                 mov Key_Map[Escape],Off
  1808.  
  1809. Un scancode spécial "All" est utilisé pour savoir une touche a été enfoncée
  1810. puis relâchée.
  1811.  
  1812.         Exemple, pour tester si la touche Escape à été enfoncée :
  1813.  
  1814.                 cmp Key_Map[All],Escape
  1815.                 je Touche_Escape_Enfoncer
  1816.  
  1817. Ce qui permet d'attendre une touche quelconque :
  1818.  
  1819.         @@Attend_Touche:
  1820.                 cmp Key_Map[All],Off
  1821.                 je @@Attend_Touche
  1822.                 mov Key_Map[All],Off
  1823.  
  1824. Il est bien entendu possible de désactiver le clavier et de revenir à l'ancien
  1825. gestionnaire.
  1826.  
  1827.         Restauration du clavier :
  1828.  
  1829.                 mov ah,Use_Int_09
  1830.                 mov bx,Off
  1831.                 Int_EOS
  1832.  
  1833. Note : A la fin du programme, l'E.O.S restitue toutes les interruptions la
  1834.        restauration de l'interruption 09 n'est donc pas obligatoire.
  1835.  
  1836.  
  1837. ┌──────────────────────────────────────────────────────────────────────────┐
  1838. │Use Int 09   Use Internal Keyboard handler to use keyboard                │
  1839. │                                                                          │
  1840. │In :                                                                      │
  1841. │        AH = Use_Int_09                                                   │
  1842. │        BX = On Enable Int 09                                             │
  1843. │           = Off Disable Int 09 (Default setting)                         │
  1844. │                                                                          │
  1845. │                                                                          │
  1846. │Out :                                                                     │
  1847. │                                                                          │
  1848. │                                                                          │
  1849. │Other Registers Change : None                                             │
  1850. │                                                                          │
  1851. │                                                                          │
  1852. └──────────────────────────────────────────────────────────────────────────┘
  1853.  
  1854. Exemple :
  1855.             mov ah,Use_Int_09
  1856.             mov bx,On
  1857.             Int_EOS
  1858.  
  1859.             ...
  1860.  
  1861. @@Pause:                            ; Test if key pressed
  1862.             cmp Key_Map[All],Off
  1863.             je @@Pause
  1864.             mov Key_Map[All],Off
  1865.  
  1866.             ...
  1867.  
  1868. @@Pause:                            ; Test if the Esc key is pressed
  1869.             cmp Key_Map[Escape],On  ; Actually
  1870.             jne @@Pause
  1871.  
  1872.             ...
  1873.  
  1874. @@Pause:                            ; Test if the ESC key have been pressed
  1875.             cmp Key_Map[All],Escape
  1876.             jne @@Pause
  1877.  
  1878.  
  1879. ──────────────────────────────────────────────────────────────────────────────
  1880. Les déclarations pour Key_Map (Azerty)
  1881. ──────────────────────────────────────────────────────────────────────────────
  1882.  
  1883.             All
  1884.             Escape
  1885.             Return
  1886.             Alt
  1887.             Space
  1888.             Left
  1889.             Right
  1890.             Up
  1891.             Down
  1892.             Plus
  1893.             Moins
  1894.             Ctrl
  1895.             Num_0  à Num_9
  1896.             Key_0  à Key_9
  1897.             Key_A  à Key_Z
  1898.             Key_F1 à Key_F12
  1899.  
  1900.  
  1901. ╔══════════════════════════════════════════════════════════════════════════╗
  1902. ║                                                                          ║
  1903. ║ Synchronisation avec le balayage                                         ║
  1904. ║                                                                          ║
  1905. ╚══════════════════════════════════════════════════════════════════════════╝
  1906.  
  1907. L'E.O.S possède son propre système de synchronisation.
  1908.  
  1909.         Contrôle du retracage de l'écran :
  1910.  
  1911.                 mov ah,Wait_Vbl
  1912.                 Int_EOS
  1913.  
  1914. L'utilisation de l'interruption 08 ou timer permet d'augmenter les capacités
  1915. de cette fonction. Comme pour l'interruption clavier il n'y a pas d'appel vers
  1916. les anciens gestionnaires.
  1917.  
  1918.         Activation du gestionnaire de synchronisation :
  1919.  
  1920.                 mov ah,Use_Int_08
  1921.                 mov bx,On
  1922.                 Int_EOS
  1923.  
  1924. Attention : Lorsque vous utilisez Diamond, la fonction Use_Int_08 est
  1925. automatiquement activée. Dans ce cas la, Use_Int_08 ne sert à rien.
  1926.  
  1927. En retour, Wait_Vbl renvoie alors le nombre de balayage effectué depuis le
  1928. dernier appel. Cette fonction renvoie toujours 1 si l'interruption 08 est Off.
  1929.  
  1930.                 mov ah,Wait_Vbl
  1931.                 Int_EOS
  1932.                 mov [Nbs_Vbl],eax
  1933.  
  1934. Grâce à l'utilisation de cette interruption et à la fonction Wait_Vbl votre
  1935. programme est toujours capable de savoir combien de frame il a perdu. On
  1936. dispose ainsi d'un compteur régulier très pratique pour le calcul des
  1937. déplacements.
  1938.  
  1939. La fonction, Change_Synchro_Int_08 permet de changer la fréquence de balayage
  1940. pour le timer qui est de 70hz par défaut :
  1941.  
  1942.                 mov bx,60               ; 60Hz
  1943.                 mov ah,Change_Synchro_Int_08
  1944.                 Int_EOS
  1945.  
  1946. Une macro est aussi disponible : Colors qui permet de changer une couleur
  1947. temporairement pour décomposer chaque routine de votre programme.
  1948.  
  1949.         Fonction Colors:
  1950.  
  1951.                 colors Numero_de_couleur,Valeur_Rouge,Valeur_Verte,Valeur_bleue
  1952.  
  1953.  
  1954.         Exemple d'utilisation des fonctions de balayage :
  1955.  
  1956.         @@Boucle:
  1957.                 colors 0,63,0,0     ; Première couleur en Rouge vif
  1958.                 call Procedure_1
  1959.                 colors 0,0,63,0     ; Deuxième couleur en Ver Vif
  1960.                 call Procedure_2
  1961.                 mov ah,Wait_Vbl
  1962.                 Int_EOS
  1963.         @@Compt:
  1964.                 add [Valeur_Reguliere],1
  1965.                 dec eax             ; On additionne des valeurs régulières
  1966.                 jne @@Compt
  1967.                 cmp [Key_Map+All],On
  1968.                 jne @@Boucle
  1969.  
  1970.  
  1971. ╔══════════════════════════════════════════════════════════════════════════╗
  1972. ║                                                                          ║
  1973. ║ Les fonctions de synchronisations                                        ║
  1974. ║                                                                          ║
  1975. ╚══════════════════════════════════════════════════════════════════════════╝
  1976.  
  1977. ┌─────────────────────┐
  1978. │Wait Vbl             │
  1979. │Use Int 08           │
  1980. │Change Synchro Int 08│
  1981. └─────────────────────┘
  1982.  
  1983. ┌──────────────────────────────────────────────────────────────────────────┐
  1984. │Wait Vbl   Wait the vertical retrace                                      │
  1985. │                                                                          │
  1986. │In :                                                                      │
  1987. │                                                                          │
  1988. │Out :                                                                     │
  1989. │       EAX = Number of Vbl lost since the last call                       │
  1990. │             (work only when the Int 08 is on)                            │
  1991. │                                                                          │
  1992. │Other Registers Change : None                                             │
  1993. │                                                                          │
  1994. │                                                                          │
  1995. └──────────────────────────────────────────────────────────────────────────┘
  1996.  
  1997. Exemple :
  1998.             mov ah,Wait_Vbl
  1999.             Int_EOS
  2000.  
  2001.  
  2002. ┌──────────────────────────────────────────────────────────────────────────┐
  2003. │Use Int 08   Use Int 08 (IRQ 0) to count frame rate and have a stable     │
  2004. │             vertical retrace                                             │
  2005. │             Defaults frequency is 70Hz                                   │
  2006. │                                                                          │
  2007. │In :                                                                      │
  2008. │        AH = Use_Int_08                                                   │
  2009. │        BX = On Enable Int 08                                             │
  2010. │           = Off Disable Int 08                                           │
  2011. │                                                                          │
  2012. │                                                                          │
  2013. │Out :                                                                     │
  2014. │                                                                          │
  2015. │                                                                          │
  2016. │Other Registers Change : None                                             │
  2017. │                                                                          │
  2018. │                                                                          │
  2019. └──────────────────────────────────────────────────────────────────────────┘
  2020.  
  2021. Exemple :
  2022.             mov ah,Use_Int_08
  2023.             mov bx,On
  2024.             Int_EOS
  2025.  
  2026.  
  2027. ┌──────────────────────────────────────────────────────────────────────────┐
  2028. │Change Synchro Int 08   Change frequency for Interupt 08                  │
  2029. │                        Defaults frequency is 70Hz                        │
  2030. │                                                                          │
  2031. │In :                                                                      │
  2032. │        BX = frequency                                                    │
  2033. │        AH = Change_Synchro_Int_08                                        │
  2034. │                                                                          │
  2035. │Out :                                                                     │
  2036. │                                                                          │
  2037. │                                                                          │
  2038. │Other Registers Change : None                                             │
  2039. │                                                                          │
  2040. │                                                                          │
  2041. └──────────────────────────────────────────────────────────────────────────┘
  2042.  
  2043. Exemple :
  2044.             mov bx,70                   ; 70hz
  2045.             mov ah,Change_Synchro_Int_08
  2046.             Int_EOS
  2047.  
  2048.  
  2049. ╔══════════════════════════════════════════════════════════════════════════╗
  2050. ║                                                                          ║
  2051. ║ Les variables                                                            ║
  2052. ║                                                                          ║
  2053. ╚══════════════════════════════════════════════════════════════════════════╝
  2054.  
  2055. L'E.O.S possède quelques variables 'global' qui peuvent être nécessaires à
  2056. tout moment lors de l'exécution d'un programme :
  2057.  
  2058.  
  2059. ───────────────────────────────────────────────────────────────────────────────
  2060. Code32_Sel
  2061. ───────────────────────────────────────────────────────────────────────────────
  2062.  
  2063. Sélecteur de code (CS).
  2064.  
  2065.         Exemple : Détourner l'interruption 70h :
  2066.  
  2067.                 mov ah,Set_Int
  2068.                 mov bx,70h
  2069.                 mov cx,[Code32_Sel]         ; Sélecteur
  2070.                 mov edx,O New_Int_70h       ; Offset de la nouvelle routine
  2071.                 Int_EOS
  2072.  
  2073. Attention ! En mode protégé, il est interdit de faire :
  2074.  
  2075.                 mov cs:[Valeur],10
  2076.  
  2077. Cela déclencherait une exception et arrêterait votre programme.
  2078.  
  2079.  
  2080. ───────────────────────────────────────────────────────────────────────────────
  2081. Data32_Sel
  2082. ───────────────────────────────────────────────────────────────────────────────
  2083.  
  2084. Sélecteur de Données (DS).
  2085.  
  2086.         Exemple d'utilisation de Data32_Sel :
  2087.  
  2088.                 Valeur  dd 0
  2089.  
  2090.                 mov [Valeur],10
  2091.  
  2092. En fait, les sélecteurs Code32_Sel et Data32_Sel sont identiques.
  2093. La différence porte sur leur accès. Code32_Sel est en lecture alors
  2094. que Data32_Sel est en lecture et écriture.
  2095.  
  2096. Au début d'un programme tous les sélecteurs (sauf CS) sont initialisés avec la
  2097. valeur de Data32_Sel.
  2098.  
  2099. Attention : Sous WATCOM, le sélecteur ES pointe sur le PSP du programme.
  2100.  
  2101.  
  2102. ───────────────────────────────────────────────────────────────────────────────
  2103. Flat_Data_Sel, Flat_Code_Sel
  2104. ───────────────────────────────────────────────────────────────────────────────
  2105.  
  2106. Sélecteurs qui ont pour origine l'adresse zéro de la mémoire. Très utile pour
  2107. lire les variables du BIOS. Flat_Data_Sel est en lecture et écriture mais il
  2108. ne peut pas être utilisé pour exécuter du code tandis que Flat_Code_Sel est en
  2109. lecture seulement mais peut être utilisé pour exécuter du code.
  2110.  
  2111.         Lire le mode vidéo courant :
  2112.  
  2113.                 push es
  2114.                 mov es,cs:[Flat_Code_Sel]
  2115.                 mov al,es:[449h]            ; 40h:49h en mode réel
  2116.                 pop es
  2117.  
  2118.  
  2119.  
  2120. ───────────────────────────────────────────────────────────────────────────────
  2121. Sélecteur 40h
  2122. ───────────────────────────────────────────────────────────────────────────────
  2123.  
  2124. Sélecteurs qui permet d'accéder directement aux variables du BIOS :
  2125.  
  2126.         Lire le mode vidéo courant :
  2127.  
  2128.                 push es
  2129.                 mov ax,40h
  2130.                 mov es,ax
  2131.                 mov al,es:[49h]             ; 40h:49h en mode réel
  2132.                 pop es
  2133.  
  2134.  
  2135. ───────────────────────────────────────────────────────────────────────────────
  2136. Real_DS,Real_ES,Real_FS,Real_GS,Real_SS,Real_SP
  2137. ───────────────────────────────────────────────────────────────────────────────
  2138.  
  2139. Ces variables contiennent les futures valeurs des différents segments lors d'un
  2140. appel en mode réel (Voir Le mode Réel).
  2141.  
  2142.  
  2143. ───────────────────────────────────────────────────────────────────────────────
  2144. _0b0000h, _0b8000h, _0a0000h
  2145. ───────────────────────────────────────────────────────────────────────────────
  2146.  
  2147. Ces variables contiennent les différentes adresses 32 bits de la VRAM.
  2148.  
  2149.  
  2150. ╔══════════════════════════════════════════════════════════════════════════╗
  2151. ║                                                                          ║
  2152. ║ Les Macros                                                               ║
  2153. ║                                                                          ║
  2154. ╚══════════════════════════════════════════════════════════════════════════╝
  2155.  
  2156. L'E.O.S possède des macros qui permettent de simplifier la programmation.
  2157.  
  2158. ───────────────────────────────────────────────────────────────────────────────
  2159. Macro Colors
  2160. ───────────────────────────────────────────────────────────────────────────────
  2161.  
  2162.                 colors Numéro_de_couleur,Valeur_Rouge,Valeur_Verte,Valeur_bleu
  2163.  
  2164.         (Voir Synchronisation avec le balayage)
  2165.  
  2166.  
  2167. ───────────────────────────────────────────────────────────────────────────────
  2168. Macro Get_Param
  2169. ───────────────────────────────────────────────────────────────────────────────
  2170.  
  2171.                 Get_Param Param_Buffer
  2172.  
  2173.                 ...
  2174.  
  2175.                 Param_Buffer db 128 dup (0)
  2176.  
  2177.         Renvoie dans Param_Buffer les paramètres de la ligne de commande.
  2178.  
  2179.  
  2180. ───────────────────────────────────────────────────────────────────────────────
  2181. Macro Send
  2182. ───────────────────────────────────────────────────────────────────────────────
  2183.  
  2184.                 Send Valeur_A_Afficher,X,Y
  2185.  
  2186.         (Voir Gestion d'un second écran monochrome)
  2187.  
  2188.  
  2189. ───────────────────────────────────────────────────────────────────────────────
  2190. Macro DosInt
  2191. ───────────────────────────────────────────────────────────────────────────────
  2192.  
  2193.                 DosInt Numéro_d_interruption
  2194.  
  2195.         (Voir Le mode réel)
  2196.  
  2197.  
  2198. ───────────────────────────────────────────────────────────────────────────────
  2199. Macro DosCall
  2200. ───────────────────────────────────────────────────────────────────────────────
  2201.  
  2202.                 DosCall Adresse_Mode_réel
  2203.  
  2204.         (Voir Le mode réel)
  2205.  
  2206.  
  2207. ───────────────────────────────────────────────────────────────────────────────
  2208. Macro Init_es_di
  2209. ───────────────────────────────────────────────────────────────────────────────
  2210.  
  2211.                 Init_es_di Offset adresse_32_bits
  2212.  
  2213.         (Voir Le mode réel)
  2214.  
  2215.  
  2216. ───────────────────────────────────────────────────────────────────────────────
  2217. Macro Init_ds_dx
  2218. ───────────────────────────────────────────────────────────────────────────────
  2219.  
  2220.                 Init_ds_dx Offset adresse_32_bits
  2221.  
  2222.         (Voir Le mode réel)
  2223.  
  2224.  
  2225. ╔══════════════════════════════════════════════════════════════════════════╗
  2226. ║                                                                          ║
  2227. ║ Le mode réel                                                             ║
  2228. ║                                                                          ║
  2229. ╚══════════════════════════════════════════════════════════════════════════╝
  2230.  
  2231. Le mode réel est accessible à partir de l'E.O.S à l'aide de quatre macros et
  2232. de six variables :
  2233.  
  2234.         DosInt          macro Int_Number
  2235.         DosCALL         macro _Seg_,_Ofs_
  2236.         Init_es_di      macro Adrs
  2237.         Init_ds_dx      macro Adrs
  2238.  
  2239.         Real_GS         :dword
  2240.         Real_FS         :dword
  2241.         Real_DS         :dword
  2242.         Real_ES         :dword
  2243.         Real_SS         :dword
  2244.         Real_SP         :dword
  2245.  
  2246. En mode protégé, il n'y a plus de registres de segments mais des sélecteurs.
  2247. Les variables Real_xx contiennent par conséquent les valeurs des différents
  2248. segments lors d'un appel en mode réel. Si une interruption du DOS à besoin de
  2249. retourner un paramètre dans ES, celui-ci est retourné dans Real_ES. Real_ES
  2250. correspond donc au registre de segment ES du mode réel.
  2251.  
  2252.  
  2253.         Pour appeler une interruption (Int) du mode réel :
  2254.  
  2255.                 DosInt Numéro_d_interruption
  2256.  
  2257.         Exemple :
  2258.  
  2259.                 mov ax,13h                  ; Mode 320x200 256 Couleurs
  2260.                 DosInt 10h                  ; Appel de la fonction BIOS
  2261.                                             ; Set Video Mode
  2262.  
  2263.         Pour appeler une fonction (Call) en mode réel :
  2264.  
  2265.                 DosCall Adresse_Mode_réel
  2266.  
  2267.         Exemple :
  2268.  
  2269.                 XMS_Adresse dw 0,0
  2270.  
  2271.                 mov ax,4300h                ; Fonction qui teste si un
  2272.                 DosInt 2fh                  ; Driver XMS est présent
  2273.                 cmp al,80h
  2274.                 je No_XMS_Driver
  2275.                 mov ax,4310h                ; Si oui demande son point
  2276.                 DosInt 2fh                  ; d'entré
  2277.                 mov [XMS_Adresse],bx
  2278.                 mov eax,[Real_ES]
  2279.                 mov [XMS_Adresse+2],ax
  2280.                 xor ah,ah                   ; Fonction 0 du driver XMS
  2281.                 DosCall Dword Ptr [XMS_Adresse] ; Get XMS Version
  2282.  
  2283.  
  2284.         Pour initialiser les variables qui seront utilisées en mode réel :
  2285.  
  2286.                 Init_es_di Adresse_32bits
  2287.                 Init_ds_dx Adresse_32bits
  2288.  
  2289.         Exemple :
  2290.  
  2291.                 Vesa_Buffer db 256 dup (0)
  2292.  
  2293.                 Init_es_di Vesa_Buffer
  2294.                 mov ax,4f00h                ; Teste la présence d'un
  2295.                 DosInt 10h                  ; Driver VESA
  2296.  
  2297.                 cmp dword ptr Vesa_Buffer,'ASEV'
  2298.                 jne no_vesa
  2299.  
  2300.  
  2301. ╔══════════════════════════════════════════════════════════════════════════╗
  2302. ║                                                                          ║
  2303. ║ Les interruptions                                                        ║
  2304. ║                                                                          ║
  2305. ╚══════════════════════════════════════════════════════════════════════════╝
  2306.  
  2307. L'E.O.S permet de modifier les interruptions grâce aux fonctions Get_Int et
  2308. Set_Int.
  2309.  
  2310.         Exemple : Détourner l'interruption 70h :
  2311.  
  2312.                 mov ah,Get_Int              ; Lit L'ancien vecteur
  2313.                 mov bx,70h
  2314.                 Int_EOS
  2315.                 mov [Old_Selector_Int_70h],cx
  2316.                 mov [Old_Offset_Int_70h],edx
  2317.                 mov ah,Set_Int
  2318.                 mov bx,70h
  2319.                 mov cx,[Code32_Sel]         ; Sélecteur
  2320.                 mov edx,O New_Int_70h       ; Offset de la nouvelle routine
  2321.                 Int_EOS
  2322.  
  2323.  
  2324. L'E.O.S met aussi à la disposition du programmeur toute une série de fonctions
  2325. accessibles via l'interruption 21h.
  2326.  
  2327.  
  2328.         Exemple : Afficher un message :
  2329.  
  2330.                 Msg db 'Hello Word',13,10,36
  2331.  
  2332.                 mov ah,9                    ; Fonction Display String
  2333.                 mov edx,Offset Msg
  2334.                 int 21h
  2335.                 mov ax,4c00h
  2336.                 int 21h
  2337.  
  2338. Attention ! Pour terminer un programme il faut IMPERATIVEMENT appeler la
  2339.             fonction 4ch de l'interruption 21h
  2340.  
  2341.  
  2342. Tous les appels à des interruptions à partir du mode protégé sont
  2343. automatiquement transférés en mode réel :
  2344.  
  2345.                 xor ax,ax
  2346.                 int 33h
  2347.  
  2348.                 est équivalent à :
  2349.  
  2350.                 xor ax,ax
  2351.                 DosInt 33h
  2352.  
  2353.  
  2354. ╔══════════════════════════════════════════════════════════════════════════╗
  2355. ║                                                                          ║
  2356. ║ Les IRQ ou interruptions matérielles                                     ║
  2357. ║                                                                          ║
  2358. ╚══════════════════════════════════════════════════════════════════════════╝
  2359.  
  2360. Toutes les IRQs sont accessibles dans votre programme. Par contre L'E.O.S a
  2361. reprogammé ses interruptions pour éviter des conflits avec les exceptions du
  2362. mode protégé. Pour utiliser une IRQ l'E.O.S met deux fonctions à la
  2363. disposition du programmeur :
  2364.  
  2365.         Get_IRQ :
  2366.  
  2367.                 Fonction qui renvoie l'adresse d'une IRQ.
  2368.  
  2369.         Set_IRQ :
  2370.  
  2371.                 Fonction qui détourne une IRQ.
  2372.  
  2373.  
  2374.         Exemple d'utilisation :
  2375.  
  2376.         Old_IRQ0 Label Fword
  2377.         Old_Offset_IRQ0    dd 0
  2378.         Old_Selector_IRQ0  dw 0
  2379.  
  2380.                 mov ah,Get_IRQ
  2381.                 mov bl,0            ; IRQ timer
  2382.                 Int_EOS
  2383.                 mov [Old_Selector_IRQ0],cx
  2384.                 mov [Old_Offset_IRQ0],edx
  2385.                 mov ah,Set_IRQ
  2386.                 mov bl,0            ; IRQ timer
  2387.                 mov cx,cs
  2388.                 mov edx,Offset New_IRQ0
  2389.                 Int_EOS
  2390.                 ...
  2391.  
  2392.         New_IRQ0:
  2393.                 ...
  2394.                 jmp fword ptr cs:[Old_IRQ0]
  2395.  
  2396.  
  2397. Vous pouvez également utiliser les fonctions du mode réel :
  2398.  
  2399.                 mov ax,2508h        ; Détourner l'IRQ timer via Dos
  2400.                 init_ds_dx,Mon_Programme
  2401.                 int 21h
  2402.  
  2403.  
  2404. ╔══════════════════════════════════════════════════════════════════════════╗
  2405. ║                                                                          ║
  2406. ║ Les Exceptions                                                           ║
  2407. ║                                                                          ║
  2408. ╚══════════════════════════════════════════════════════════════════════════╝
  2409.  
  2410. ───────────────────────────────────────────────────────────────────────────────
  2411. Différence entre une exception et une intèrruption
  2412. ───────────────────────────────────────────────────────────────────────────────
  2413.  
  2414. Une exception est une interruption qui a la falculté de se déclencher à l'
  2415. intérieur d'une instruction. Par exemple :
  2416.  
  2417.         mov ecx,-1
  2418.         rep movsb       ; Une interruption doit attendre la fin du rep movsb
  2419.                           pour être prise en compte.
  2420.  
  2421.  
  2422. ───────────────────────────────────────────────────────────────────────────────
  2423. En cas de plantage
  2424. ───────────────────────────────────────────────────────────────────────────────
  2425.  
  2426. Toutes les exceptions sont gérées par l'E.O.S.
  2427.  
  2428. Lorsque l'une d'elle se déclenche, l'E.O.S arrête votre programme et restitue
  2429. automatiquement la mémoire allouée et le mode vidéo de départ.
  2430.  
  2431.  
  2432. ───────────────────────────────────────────────────────────────────────────────
  2433. Comment détourner une exception sous E.O.S.
  2434. ───────────────────────────────────────────────────────────────────────────────
  2435.  
  2436. Les exceptions sont gérées comme en DPMI. Elles possèdent une stucture en
  2437. entrée et un retf en sortie (voir doc du DPMI).
  2438.  
  2439.  
  2440. ╔══════════════════════════════════════════════════════════════════════════╗
  2441. ║                                                                          ║
  2442. ║ Les fonctions pour gérer les interruptions                               ║
  2443. ║                                                                          ║
  2444. ╚══════════════════════════════════════════════════════════════════════════╝
  2445.  
  2446. ┌───────┐
  2447. │Get Int│
  2448. │Set Int│
  2449. │Get Irq│
  2450. │Set Irq│
  2451. └───────┘
  2452.  
  2453. ┌──────────────────────────────────────────────────────────────────────────┐
  2454. │Get_Int       Get protected mode interrupt vector                         │
  2455. │                                                                          │
  2456. │In :                                                                      │
  2457. │        AH = Get_Int                                                      │
  2458. │        BX = Interrupt number                                             │
  2459. │                                                                          │
  2460. │Out :                                                                     │
  2461. │    CX:EDX = Selector:Offset of interrupt                                 │
  2462. │                                                                          │
  2463. │Autre Registre Modifie : Aucun                                            │
  2464. │                                                                          │
  2465. │                                                                          │
  2466. └──────────────────────────────────────────────────────────────────────────┘
  2467.  
  2468. Exemple :
  2469.             mov ah,Get_Int
  2470.             mov bx,10h
  2471.             Int_EOS
  2472.             mov [Old_Int_10_Selector],cx
  2473.             mov [Old_Int_10_Offset],edx
  2474.  
  2475.  
  2476. ┌──────────────────────────────────────────────────────────────────────────┐
  2477. │Set_Int       Set protected mode interrupt vector                         │
  2478. │                                                                          │
  2479. │In :                                                                      │
  2480. │        AH = Get_Int                                                      │
  2481. │        BX = Interrupt number                                             │
  2482. │    CX:EDX = Selector:Offset of interrupt                                 │
  2483. │                                                                          │
  2484. │Out :                                                                     │
  2485. │                                                                          │
  2486. │Autre Registre Modifie : Aucun                                            │
  2487. │                                                                          │
  2488. │                                                                          │
  2489. └──────────────────────────────────────────────────────────────────────────┘
  2490.  
  2491. Exemple :
  2492.             mov ah,Set_Int
  2493.             mov bx,10h
  2494.             mov cx,cs
  2495.             mov edx,O New_Int_10
  2496.             Int_EOS
  2497.  
  2498.  
  2499. ┌──────────────────────────────────────────────────────────────────────────┐
  2500. │Get_Irq       Get protected mode irq vector                               │
  2501. │                                                                          │
  2502. │In :                                                                      │
  2503. │        AH = Get_Irq                                                      │
  2504. │        BX = Irq number                                                   │
  2505. │                                                                          │
  2506. │Out :                                                                     │
  2507. │    CX:EDX = Selector:Offset of irq                                       │
  2508. │                                                                          │
  2509. │Autre Registre Modifie : Aucun                                            │
  2510. │                                                                          │
  2511. │                                                                          │
  2512. └──────────────────────────────────────────────────────────────────────────┘
  2513.  
  2514. Exemple :
  2515.             mov ah,Get_Irq
  2516.             mov bx,1h                               ; Keyboard
  2517.             Int_EOS
  2518.             mov [Old_Irq_01_Selector],cx
  2519.             mov [Old_Irq_01_Offset],edx
  2520.  
  2521.  
  2522. ┌──────────────────────────────────────────────────────────────────────────┐
  2523. │Set_Irq       Set protected mode irq vector                               │
  2524. │                                                                          │
  2525. │In :                                                                      │
  2526. │        AH = Get_Irq                                                      │
  2527. │        BX = Irq number                                                   │
  2528. │    CX:EDX = Selector:Offset of irq                                       │
  2529. │                                                                          │
  2530. │Out :                                                                     │
  2531. │                                                                          │
  2532. │Autre Registre Modifie : Aucun                                            │
  2533. │                                                                          │
  2534. │                                                                          │
  2535. └──────────────────────────────────────────────────────────────────────────┘
  2536.  
  2537. Exemple :
  2538.             mov ah,Set_Irq
  2539.             mov bx,1h                               ; Keyboard
  2540.             mov cx,cs
  2541.             mov edx,O New_Irq_01
  2542.             Int_EOS
  2543.  
  2544.  
  2545. ╔══════════════════════════════════════════════════════════════════════════╗
  2546. ║                                                                          ║
  2547. ║ Le linker                                                                ║
  2548. ║                                                                          ║
  2549. ╚══════════════════════════════════════════════════════════════════════════╝
  2550.  
  2551. L'E.O.S dispose d'un utilitaire (LLINK.EXE) qui permet de créer un seul
  2552. fichier exécutable à partir de plusieurs fichiers de données.
  2553.  
  2554.         programme.exe
  2555.         image.pcx        ---->   final.exe
  2556.         musique.mod
  2557.  
  2558. Une fois linké, les fichiers de données sont accessibles très facilement à
  2559. l'aide de la fonction Load_internal_File.
  2560.  
  2561.         Exemple d'utilisation de Load_Internal_File et de Load_External_File :
  2562.  
  2563.                 Fichier_Linker  db 'IMAGE.PIC',0
  2564.                 Fichier_Externe db 'PRG.CFG',0
  2565.  
  2566.                 mov ah,Load_Internal_File   ; Charge un fichier interne
  2567.                 mov edx,O Fichier_Linker
  2568.                 Int_EOS
  2569.  
  2570.                 Pas d'erreurs possibles car elles sont gérées par l'E.O.S.
  2571.  
  2572.  
  2573.                 mov ah,Load_External_File   ; Charge un fichier externe
  2574.                 mov edx,O Fichier_Externe
  2575.                 Int_EOS
  2576.                 jc Error_Loading
  2577.  
  2578.                 Gestion des erreurs par l'utilisateur.
  2579.  
  2580.  
  2581. Pour indiquer à LLINK la liste des fichiers à linker il suffit de créer un
  2582. fichier de lien comme ci-dessous.
  2583.  
  2584.         Contenu d'un fichier de lien (prg.eos) :
  2585.  
  2586.                 FINAL.EXE                   ; Nom de l'exécutable à créer
  2587.                 PRG.EXE                     ; Nom de l'exécutable à linker
  2588.                 IMAGE.PCX                   ; Fichier de données à linker
  2589.                 MUSIQUE.MOD                 ; Fichier de données à linker
  2590.                 :END                        ; Fin
  2591.  
  2592.         Linkage :
  2593.  
  2594.                 LLINK prg.eos
  2595.  
  2596. Afin de faciliter la programmation, il est possible d'utiliser la fonction
  2597. Load_Internal_File avec des fichiers externes, ce qui permet de linker un
  2598. programme lorsqu'il est entièrement terminé (Voir Example4).
  2599.  
  2600.  
  2601. ╔══════════════════════════════════════════════════════════════════════════╗
  2602. ║                                                                          ║
  2603. ║ Le Debugger 32 bits                                                      ║
  2604. ║                                                                          ║
  2605. ╚══════════════════════════════════════════════════════════════════════════╝
  2606.  
  2607. ───────────────────────────────────────────────────────────────────────────────
  2608. DEBUG.OBJ
  2609. ───────────────────────────────────────────────────────────────────────────────
  2610.  
  2611. Le debugger DEBUG.OBJ est un fichier objet externe qu'il vous suffit d'inclure
  2612. au moment du linkage :
  2613.  
  2614.         TLINK eos+mon_programme+debug /x /3
  2615.  
  2616.  
  2617. Pour l'appeler à partir de votre programme une fonction est mise à votre
  2618. disposition : DEBUG. Vous pouvez ainsi activer le debugger à
  2619. n'importe quel instant à l'aide d'un simple Call :
  2620.  
  2621. Exemple d'appel du debugger sous E.O.S.
  2622.  
  2623.         Locals
  2624.         .386
  2625.         CODE32 SEGMENT PUBLIC PARA 'CODE' USE32
  2626.         ASSUME  CS:CODE32,DS:CODE32,ES:CODE32
  2627.  
  2628.         INCLUDE ..\RESOURCE\EOS.INC
  2629.  
  2630.         Msg         db '    ■ Hello world...',13,10,36
  2631.  
  2632.         Start32:
  2633.  
  2634.             call debug              ; Where you want !!! Alt-x to exit
  2635.  
  2636.             mov ah,9
  2637.             mov edx,O Msg
  2638.             int 21h                 ; Call Display String
  2639.  
  2640.             mov ax,4c00h
  2641.             int 21h                 ; Exit with Error Code 0
  2642.  
  2643.         CODE32 ENDS
  2644.         END
  2645.  
  2646.  
  2647. Exemple d'appel du debugger sous WATCOM
  2648.  
  2649.         void main()
  2650.         {
  2651.         init_EOS();
  2652.         debug();
  2653.         printf("    ■ Hello world...\x0D\x0A");
  2654.         exit(0);
  2655.         }
  2656.  
  2657.  
  2658. Les fonctions du debugger sont les suivantes :
  2659.  
  2660. Pause       Break      Permet d'appeler le debugger à tout instant
  2661. Alt-X       Exit       Permet de quitter le debugger à tout instant
  2662. F1          Mono       Le debugger passe sur l'écran monochrome
  2663. F2          Color      Le debugger passe sur l'écran couleur
  2664. F3          Nop        Permet de placer des instructions NOP dans la fenêtre
  2665.                        de code
  2666. F4          Here       Permet d'aller à un point précis du programme
  2667. F5          Fpu        Remplace la fénètre Dump par les registres du
  2668.                        co-processeur
  2669. Alt-F5      UsrScr     Affiche l'écran vidéo du programme
  2670. F7          Next       Pour tracer à l'intérieur des procédures
  2671. Alt-F7      Int        Pour tracer à l'intérieur des interruptions
  2672. F8          Trace      Pour tracer sans rentrer dans les procédures
  2673. F9          Run        Pour rendre la main au programme
  2674. F10         BreakPoint Pour placer un point d'arrêt dans la fenêtre code
  2675. F11         Origin     Pour positionner la fenêtre code sur CS:EIP
  2676. F12         About      Pour connaître la version du debugger
  2677. Alt         Toggle     Remplace la fenêtre des registres par celle des
  2678.                        sélecteurs
  2679. Arrows      ScrollDump Scroll la fenêtre Code
  2680. Alt Arrows  ScrollCode Scroll la fenêtre Dump
  2681. Ctrl Arrows DecalCode  Décalage du désassemblage
  2682. Ctrl N      NewEIP     Permet de changer CS:EIP
  2683. Ctrl D      NewDump    Permet de changer l'adresse de la fenêtre Dump
  2684. Ctrl G      Goto       Permet d'aller à un point précis du programme
  2685. Ctrl H      Help       Affiche un écran d'aide
  2686.  
  2687. A chaque fois que le debugger rencontre une interruption de l'E.O.S, du DOS
  2688. ou du DPMI, celui indique en clair la fonction demandée.
  2689.  
  2690. Exemple :
  2691.             mov ah,9h
  2692.             int 21              = Display String
  2693.  
  2694.             mov ax,300h
  2695.             int 31h             = Simulate Real Mode Interrupt
  2696.  
  2697.             mov ah,47h
  2698.             Int_EOS             = Physical Address Mapping
  2699.  
  2700.  
  2701. Un utilitaire est aussi fourni pour configurer le debugger : EDCONFIG.EXE.
  2702. Pour plus d'infos taper EDCONFIG -h
  2703.  
  2704.  
  2705. ───────────────────────────────────────────────────────────────────────────────
  2706. WDEBUG.EXE
  2707. ───────────────────────────────────────────────────────────────────────────────
  2708.  
  2709. Vous pouvez aussi utiliser WDEBUG pour tracer des programmes au format LE.
  2710.  
  2711. Pour cela il faut extraire DOG4GW du programme EXE avec PMWBIND :
  2712.  
  2713.   PMWBIND /U fichier.EXE
  2714.  
  2715. Vous pouvez alors lancer le programme pour le debugger :
  2716.  
  2717.   WDEBUG fichier.LE
  2718.  
  2719. Pour appeler le debugger appuyez simplement sur la touche Pause.
  2720.  
  2721.  
  2722. ╔══════════════════════════════════════════════════════════════════════════╗
  2723. ║                                                                          ║
  2724. ║ Les fonctions du Debuggeur 32 bits                                       ║
  2725. ║                                                                          ║
  2726. ╚══════════════════════════════════════════════════════════════════════════╝
  2727.  
  2728. ┌───────────┐
  2729. │Debug      │
  2730. │Debug Back │
  2731. └───────────┘
  2732.  
  2733. ┌──────────────────────────────────────────────────────────────────────────┐
  2734. │Debug             Initialize and call the debugger                        │
  2735. │                                                                          │
  2736. │                                                                          │
  2737. │                                                                          │
  2738. │In :                                                                      │
  2739. │                                                                          │
  2740. │Out :                                                                     │
  2741. │                                                                          │
  2742. │Other Registers Change : None                                             │
  2743. │                                                                          │
  2744. └──────────────────────────────────────────────────────────────────────────┘
  2745.  
  2746. Exemple :
  2747.             call debug
  2748.  
  2749.  
  2750. ┌──────────────────────────────────────────────────────────────────────────┐
  2751. │Debug_Back        Initialize the debugger for Pause-key and Break_Point   │
  2752. │                                                                          │
  2753. │                                                                          │
  2754. │                                                                          │
  2755. │In :                                                                      │
  2756. │                                                                          │
  2757. │Out :                                                                     │
  2758. │                                                                          │
  2759. │Other Registers Change : None                                             │
  2760. │                                                                          │
  2761. └──────────────────────────────────────────────────────────────────────────┘
  2762.  
  2763. Exemple :
  2764.             call debug_Back
  2765.  
  2766.  
  2767. ╔══════════════════════════════════════════════════════════════════════════╗
  2768. ║                                                                          ║
  2769. ║ Appel du debugger par Break point                                        ║
  2770. ║                                                                          ║
  2771. ╚══════════════════════════════════════════════════════════════════════════╝
  2772.  
  2773. ┌───────────┐
  2774. │Break Point│
  2775. └───────────┘
  2776.  
  2777. ┌──────────────────────────────────────────────────────────────────────────┐
  2778. │Break_Point       call the debugger                                       │
  2779. │                                                                          │
  2780. │                                                                          │
  2781. │                                                                          │
  2782. │In :                                                                      │
  2783. │                                                                          │
  2784. │Out :                                                                     │
  2785. │                                                                          │
  2786. │Other Registers Change : None                                             │
  2787. │                                                                          │
  2788. └──────────────────────────────────────────────────────────────────────────┘
  2789.  
  2790. Exemple :
  2791.             Break_Point
  2792.  
  2793.  
  2794. ╔══════════════════════════════════════════════════════════════════════════╗
  2795. ║                                                                          ║
  2796. ║ Restitution automatique de l'environnement de départ                     ║
  2797. ║                                                                          ║
  2798. ╚══════════════════════════════════════════════════════════════════════════╝
  2799.  
  2800. Vous n'êtes pas obligé de libérer la mémoire avant de quitter votre
  2801. programme.  A chaque fois qu'il rencontre la fonction 4c00h ou lors d'un
  2802. plantage programme, l'E.O.S restitue automatiquement l'environnement de
  2803. départ :
  2804.  
  2805.                 ■ Le mode vidéo y compris les modes VESA (132x60,etc...)
  2806.                 ■ L'heure de l'horloge.
  2807.                 ■ Les interruptions.
  2808.                 ■ La mémoire allouée.
  2809.                 ■ Stoppe la musique.
  2810.  
  2811.  
  2812. Il est également possible de restituer à tout moment le mode vidéo de départ...
  2813.  
  2814.                 mov ah,Restore_Video_Mode
  2815.                 Int_EOS
  2816.  
  2817.  
  2818. Pour les erreurs, l'E.O.S dispose d'une sortie spécialisée qui permet d'afficher
  2819. un message d'erreur :
  2820.  
  2821.                 mov ah,Exit_Error
  2822.                 mov edx,Offset Error_Txt
  2823.                 Int_EOS
  2824.  
  2825.  
  2826. Cette fonction est identique à :
  2827.  
  2828.                 mov ah,9                    ; Fonction Display String
  2829.                 mov edx,Offset Msg
  2830.                 int 21h
  2831.                 mov ax,4c01h
  2832.                 int 21h
  2833.  
  2834.  
  2835. L'E.O.S vous permet également d'écrire directement en Ram vidéo et d'employer
  2836. des couleurs avec la fonction Direct_Send :
  2837.  
  2838.                 lea edx,Message
  2839.                 mov ah,Direct_Send
  2840.                 Int_EOS
  2841.  
  2842.                 ...
  2843.  
  2844. Message         db "    ",0,1,"■ Color Blue ",0,4,"Red ",13,10,0,0
  2845.  
  2846.  
  2847.  
  2848. ╔══════════════════════════════════════════════════════════════════════════╗
  2849. ║                                                                          ║
  2850. ║ Les Fonctions système                                                    ║
  2851. ║                                                                          ║
  2852. ╚══════════════════════════════════════════════════════════════════════════╝
  2853.  
  2854. ┌──────────────────────────────────────────────────────────────────────────┐
  2855. │Exit Error                                                                │
  2856. │Restore Video Mode                                                        │
  2857. │Detect Windows                                                            │
  2858. │Direct Send                                                               │
  2859. └──────────────────────────────────────────────────────────────────────────┘
  2860.  
  2861. ┌──────────────────────────────────────────────────────────────────────────┐
  2862. │Exit Error   Restore initial Video mode , interrupts , free all reserved  │
  2863. │             memory ,stop music if played and exit (with error code 1)    │
  2864. │             with a error message                                         │
  2865. │                                                                          │
  2866. │In :                                                                      │
  2867. │        AH = Exit_Error                                                   │
  2868. │    DS:EDX = Offset message to display                                    │
  2869. │                                                                          │
  2870. │Out :                                                                     │
  2871. │                                                                          │
  2872. │Other Registers Change : None                                             │
  2873. │                                                                          │
  2874. │                                                                          │
  2875. └──────────────────────────────────────────────────────────────────────────┘
  2876.  
  2877. Exemple :
  2878.             mov ah,Exit_Error
  2879.             mov edx,Offset Error_Txt
  2880.             Int_EOS
  2881.  
  2882.  
  2883. ┌──────────────────────────────────────────────────────────────────────────┐
  2884. │Restore Video Mode   Restore the inital video which is be active at the   │
  2885. │                     start of the program                                 │
  2886. │                                                                          │
  2887. │In :                                                                      │
  2888. │        AH = Restore_Video_Mode                                           │
  2889. │                                                                          │
  2890. │Out :                                                                     │
  2891. │                                                                          │
  2892. │Other Registers Change : None                                             │
  2893. │                                                                          │
  2894. │                                                                          │
  2895. └──────────────────────────────────────────────────────────────────────────┘
  2896.  
  2897. Exemple :
  2898.             mov ah,Restore_Video_Mode
  2899.             Int_EOS
  2900.  
  2901.  
  2902. ┌──────────────────────────────────────────────────────────────────────────┐
  2903. │Detect Windows       Detect If Windows is running                         │
  2904. │                                                                          │
  2905. │In :                                                                      │
  2906. │        AH = Detect_Windows                                               │
  2907. │                                                                          │
  2908. │Out :                                                                     │
  2909. │        AL = Windows version                                              │
  2910. │                                                                          │
  2911. │Other Registers Change : None                                             │
  2912. │                                                                          │
  2913. │                                                                          │
  2914. └──────────────────────────────────────────────────────────────────────────┘
  2915.  
  2916. Exemple :
  2917.  
  2918. Windows_3x          = 3
  2919. Windows_95          = 4
  2920.  
  2921.             lea edx,Windows_Txt
  2922.             mov ah,Detect_Windows
  2923.             Int_EOS
  2924.             or al,al
  2925.             jnz Error
  2926.  
  2927.             ...
  2928.  
  2929. Windows_Txt         db "    ■ Sorry, but this program can not run under Microsoft Windows (tm)",13,10,36
  2930.  
  2931.  
  2932. ┌──────────────────────────────────────────────────────────────────────────┐
  2933. │Direct Send          Write a text directly to video ram . Color allowed   │
  2934. │                                                                          │
  2935. │In :                                                                      │
  2936. │        AH = Direct_Send                                                  │
  2937. │       EDX = Offset message to Display                                    │
  2938. │                                                                          │
  2939. │Out :                                                                     │
  2940. │                                                                          │
  2941. │Other Registers Change : None                                             │
  2942. │                                                                          │
  2943. │Comand  : 0,0      = end                                                  │
  2944. │          0,1..255 = color                                                │
  2945. │          13       = first colonne                                        │
  2946. │          10       = next ligne                                           │
  2947. │                                                                          │
  2948. └──────────────────────────────────────────────────────────────────────────┘
  2949.  
  2950. Exemple :
  2951.  
  2952. Direct_Send         = 0Eh
  2953. If Impossible
  2954.             lea edx,Message
  2955.             mov ah,Direct_Send
  2956.             Int_EOS
  2957.  
  2958.             ...
  2959.  
  2960. Message             db "    ",0,1,"■ Color Blue ",0,4,"Red ",13,10,0,0
  2961.  
  2962.  
  2963. ╔══════════════════════════════════════════════════════════════════════════╗
  2964. ║                                                                          ║
  2965. ║ Comment développer une librairie compatible WATCOM C et E.O.S            ║
  2966. ║                                                                          ║
  2967. ╚══════════════════════════════════════════════════════════════════════════╝
  2968.  
  2969. Pour développer une librairie à la fois compatible avec WATCOM et E.O.S, vous
  2970. devez créer deux fichiers objets différents comme ci-dessous :
  2971.  
  2972.                 - <Nom>.obj    : VESA.OBJ   (E.O.S)
  2973.                 - W<Nom>.obj   : WVESA.OBJ  (WATCOM)
  2974.  
  2975.  
  2976. Pour cela, vous pouvez générer une variable de compilation dans
  2977. votre fichier makefile, par exemple __Use_Watcom__ :
  2978.  
  2979. PRG  = VESA
  2980. RES  = ..\RESOURCE
  2981.  
  2982. $(PRG).exe:       $(PRG).obj
  2983.         @Echo $(PRG) Has Been Assembled
  2984.  
  2985. $(PRG).obj: $(PRG).asm
  2986.         @tasm3 $(PRG) $(RES)\$(PRG) /m /q /p /d__Use_Watcom__=0
  2987.         @tasm3 $(PRG) $(RES)\W$(PRG) /m /q /p /d__Use_Watcom__=1
  2988.  
  2989.  
  2990. A partir de cette variable vous pouvez ensuite gérer deux codes
  2991. dans votre fichier source :
  2992.  
  2993.         If __Use_Watom__
  2994.           ...                   ; CODE Specifique à WATCON
  2995.           ...
  2996.         Else
  2997.           ...                   ; CODE Specifique à E.O.S
  2998.           ...
  2999.         EndIF
  3000.  
  3001.  
  3002. ╔══════════════════════════════════════════════════════════════════════════╗
  3003. ║                                                                          ║
  3004. ║ Différences entre un programme E.O.S et WATCOM                           ║
  3005. ║                                                                          ║
  3006. ╚══════════════════════════════════════════════════════════════════════════╝
  3007.  
  3008. ───────────────────────────────────────────────────────────────────────────────
  3009. La gestion mémoire sous WATCOM
  3010. ───────────────────────────────────────────────────────────────────────────────
  3011.  
  3012. Sous WATCOM, la mémoire est de type FLAT et commence à l'adresse 0.
  3013. Sous E.O.S, la mémoire est définit selon l'endroit ou le programme à éte
  3014. chargé.
  3015.  
  3016.  
  3017.          Pour allouer de la memoire sous E.O.S :
  3018.  
  3019.                 mov ah,Allocate_Memory_Handle
  3020.                 mov edx,Taille
  3021.                 Int_EOS
  3022.                 mov [Adresse_Memoire],edx
  3023.                 mov [Handle_Memoire],edi
  3024.  
  3025.  
  3026.          Pour allouer de la memoire sous WATCOM :
  3027.  
  3028.                 mov ah,Allocate_Memory_Handle
  3029.                 mov edx,Taille
  3030.                 Int_EOS
  3031.                 mov [Adresse_Memoire],eax
  3032.                 mov [Handle_Memoire],edi
  3033.  
  3034.  
  3035.          Example pour utiliser les deux :
  3036.  
  3037.                 mov ah,Allocate_Memory_Handle
  3038.                 mov edx,Taille
  3039.                 Int_EOS
  3040.         If __Use_Watom__
  3041.                 mov [Adresse_Memoire],eax
  3042.         Else
  3043.                 mov [Adresse_Memoire],edx
  3044.         Endif
  3045.                 mov [Handle_Memoire],edi
  3046.  
  3047.          !!! Idem pour Load_Internal_file et Load_External_File !!!
  3048.  
  3049.  
  3050. ───────────────────────────────────────────────────────────────────────────────
  3051. Les appels aux interruptions en mode REEL
  3052. ───────────────────────────────────────────────────────────────────────────────
  3053.  
  3054.          Sous E.O.S :
  3055.  
  3056.                 Init_es_edi Buffer_Vesa
  3057.                 mov ax,4f00h
  3058.                 DosInt 10h
  3059.  
  3060.  
  3061.          Sous WATCOM :
  3062.  
  3063.                On ne peut pas adresser directement les variables ni même
  3064.                utiliser les macros init_DS_DX, car le programme est chargé
  3065.                au-dessus du premier Mega octets et le DOS ne peut atteindre
  3066.                ces variables.
  3067.                Il est donc conseillé d'allouer de la mémoire avec la fonction
  3068.                48h de l'interruption 21h pour faire la passerelle avec le mode
  3069.                réel comme ci-dessous :
  3070.  
  3071.                 xor eax,eax
  3072.                 mov ah,48h
  3073.                 mov bx,256/16
  3074.                 int 21h
  3075.                 mov edi,O DPMI_CALL
  3076.                 mov W [edi.Real_mode_Call._EAX],4f00h
  3077.                 mov [edi.Real_mode_Call._EDI],0h
  3078.                 mov [edi.Real_mode_Call._ES],ax
  3079.                 mov ax,300h
  3080.                 mov bl,10h                      ; Int 10h
  3081.                 xor cx,cx
  3082.                 int 31h                         ; Simule une interruption
  3083.  
  3084.          La structure à utiliser pour les appels DPMI est la suivante :
  3085.  
  3086.                 Real_mode_Call STRUC
  3087.                 _EDI        dd ?
  3088.                 _ESI        dd ?
  3089.                 _EBP        dd ?
  3090.                             dd ?
  3091.                 _EBX        dd ?
  3092.                 _EDX        dd ?
  3093.                 _ECX        dd ?
  3094.                 _EAX        dd ?
  3095.                 _flags      dw ?
  3096.                 _ES         dw ?
  3097.                 _DS         dw ?
  3098.                 _FS         dw ?
  3099.                 _GS         dw ?
  3100.                 _IP         dw ?
  3101.                 _CS         dw ?
  3102.                 _SP         dw ?
  3103.                 _SS         dw ?
  3104.                             ends
  3105.  
  3106.                 DPMI_CALL   Real_mode_Call <>
  3107.  
  3108.  
  3109.          Pour faciliter la création de programme il serait plus judicieux
  3110.          d'allouer de la mémoire grâce aux fonctions DOS pour avoir très
  3111.          peu de différence entre les codes sources
  3112.  
  3113.          Exemple :
  3114.  
  3115.            If __Use_Watcom__
  3116.                             mov edi,O DPMI_CALL
  3117.                             mov W [edi.Real_mode_Call._EAX],4800h
  3118.                             mov W [edi.Real_mode_Call._EBX],512/16
  3119.                             mov ax,300h
  3120.                             mov bl,10h
  3121.                             xor cx,cx
  3122.                             int 31h
  3123.                             jc  Error_vesa
  3124.                             mov edi,O DPMI_CALL
  3125.                             movzx eax,W [edi.Real_mode_Call._EAX]
  3126.            Else
  3127.                             xor eax,eax
  3128.                             mov ah,48h
  3129.                             mov bx,512/16
  3130.                             Dosint 21h
  3131.                             jnz Error_vesa
  3132.            Endif
  3133.  
  3134. @@cont:
  3135.             mov [Seg_Buffer_Vesa],eax
  3136.             shl eax,4
  3137.             sub eax,[Code32_Addr]
  3138.             mov [Addr_Buffer_Vesa],eax
  3139.  
  3140.            If __Use_Watcom__
  3141.                             mov edi,O DPMI_CALL
  3142.                             mov W [edi.Real_mode_Call._EAX],4f00h
  3143.                             mov [edi.Real_mode_Call._EDI],0h
  3144.                             mov eax,[Seg_Buffer_Vesa]
  3145.                             mov [edi.Real_mode_Call._ES],ax
  3146.                             mov ax,300h
  3147.                             mov bl,10h
  3148.                             xor cx,cx
  3149.                             int 31h
  3150.                             jc  Error_vesa
  3151.            Else
  3152.                             mov eax,[Seg_Buffer_Vesa]
  3153.                             mov [Real_ES],eax
  3154.                             xor edi,edi
  3155.                             mov ax,4f00h
  3156.                             DosInt 10h
  3157.                             cmp ax,004fh
  3158.                             jne Error_vesa
  3159.            Endif
  3160.  
  3161.             mov edi,[Addr_Buffer_Vesa]
  3162.             cmp D [edi],'ASEV'
  3163.             jnz Error_vesa
  3164.  
  3165.  
  3166. ───────────────────────────────────────────────────────────────────────────────
  3167. Les variables inutilisables sous WATCOM
  3168. ───────────────────────────────────────────────────────────────────────────────
  3169.  
  3170.          Real_DS
  3171.          Real_ES
  3172.          Real_FS
  3173.          Real_GS
  3174.          Real_SS
  3175.          Real_SS
  3176.  
  3177.          pour les raisons indiquées plus haut
  3178.  
  3179.  
  3180. ───────────────────────────────────────────────────────────────────────────────
  3181. Différence entre les fichiers sources
  3182. ───────────────────────────────────────────────────────────────────────────────
  3183.  
  3184.       Sous E.O.S
  3185.  
  3186.          Dans un Programme E.O.S le début du programme doit obligatoirement
  3187.          s'appeler START32.
  3188.  
  3189.  
  3190.       Sous WATCOM
  3191.  
  3192.          Un programme peut commencer n'importe où, il suffit juste de préciser
  3193.          la fin du programme par la commande END <Label>.
  3194.  
  3195.          Il faut obligatoirement appeler la routine Init_EOS qui émule
  3196.          les variables de l'E.O.S le plus tôt possible dans le programme.
  3197.  
  3198.          Le sélecteur ES pointe sur le PSP du Programme.
  3199.  
  3200.  
  3201.      Exemple de programme WATCOM en assembleur :
  3202.  
  3203.         Locals
  3204.         .386
  3205.         CODE32 SEGMENT PUBLIC PARA 'CODE' USE32
  3206.         ASSUME  CS:CODE32,DS:CODE32,ES:CODE32
  3207.  
  3208.         INCLUDE ..\RESOURCE\EOS.INC
  3209.  
  3210.         Msg_Hello db 'Hello World ...',13,10,36
  3211.  
  3212.         Start32:
  3213.                 call Init_EOS
  3214.                 push ds
  3215.                 pop es
  3216.                 mov ah,9
  3217.                 mov edx,O Msg_Hello
  3218.                 int 21h
  3219.                 mov ax,4c00h
  3220.                 int 21h
  3221.  
  3222.         CODE32 ENDS
  3223.                END Start32
  3224.  
  3225.  
  3226.      Exemple de programme WATCOM en C :
  3227.  
  3228.         void main()
  3229.         {
  3230.                 call Init_EOS
  3231.                 printf("    ■ Hello world...\x0D\x0A");
  3232.                 exit(0);
  3233.         }
  3234.  
  3235.  
  3236. ╔══════════════════════════════════════════════════════════════════════════╗
  3237. ║                                                                          ║
  3238. ║ Les librairies de l'E.O.S                                                ║
  3239. ║                                                                          ║
  3240. ╚══════════════════════════════════════════════════════════════════════════╝
  3241.  
  3242. Contrairement aux fonctions de l'E.O.S, les appels aux fonctions des
  3243. librairies ne se font plus par l'interruption Int_EOS mais par de simple
  3244. Call.
  3245.  
  3246. Exemple :
  3247.             mov eax,Mode640x480x256
  3248.             call Init_Vesa
  3249.             jc Error_Vesa
  3250.  
  3251.  
  3252. Les fonctions disponibles sont les suivantes :
  3253.  
  3254.  
  3255. DEBUG.OBJ
  3256. ┌──────────────────────────────────────────────────────────────────────────┐
  3257. │Debug                                                                     │
  3258. │Debug Back                                                                │
  3259. └──────────────────────────────────────────────────────────────────────────┘
  3260.  
  3261. VESA.OBJ
  3262. ┌──────────────────────────────────────────────────────────────────────────┐
  3263. │Init Vesa                                                                 │
  3264. │Init Vesa2                                                                │
  3265. │Init Vesa Bank                                                            │
  3266. │Close Vesa Bank                                                           │
  3267. │Set Bank                                                                  │
  3268. └──────────────────────────────────────────────────────────────────────────┘
  3269.  
  3270. FLI32.OBJ
  3271. ┌──────────────────────────────────────────────────────────────────────────┐
  3272. │Load Fli                                                                  │
  3273. │Load Internal Fli                                                         │
  3274. │Dispose Fli                                                               │
  3275. │First Frame Fli                                                           │
  3276. │Next Frame Fli                                                            │
  3277. └──────────────────────────────────────────────────────────────────────────┘
  3278.  
  3279. SNAP.OBJ
  3280. ┌──────────────────────────────────────────────────────────────────────────┐
  3281. │Init Snap                                                                 │
  3282. │Snap IFF                                                                  │
  3283. │Save IFF                                                                  │
  3284. └──────────────────────────────────────────────────────────────────────────┘
  3285.  
  3286. JOYSTICK.OBJ
  3287. ┌──────────────────────────────────────────────────────────────────────────┐
  3288. │Init Joystick                                                             │
  3289. │Dectect Joystick                                                          │
  3290. │Add Joystick                                                              │
  3291. │Update Joystick                                                           │
  3292. │Sub Joystick                                                              │
  3293. │Upper Left                                                                │
  3294. │Lower Right                                                               │
  3295. │Center                                                                    │
  3296. └──────────────────────────────────────────────────────────────────────────┘
  3297.  
  3298. MEMORY.OBJ
  3299. ┌──────────────────────────────────────────────────────────────────────────┐
  3300. │Init Memory                                                               │
  3301. └──────────────────────────────────────────────────────────────────────────┘
  3302.  
  3303.  
  3304. ╔══════════════════════════════════════════════════════════════════════════╗
  3305. ║                                                                          ║
  3306. ║ La librairie VESA                                                        ║
  3307. ║                                                                          ║
  3308. ╚══════════════════════════════════════════════════════════════════════════╝
  3309.  
  3310. ───────────────────────────────────────────────────────────────────────────────
  3311. Automatic Bank Switching en VESA 1.0 ou 2.0
  3312. ───────────────────────────────────────────────────────────────────────────────
  3313.  
  3314. La librairie VESA permet de ne pas se soucier de la commutation des
  3315. banks en VESA 1.0. On peut écrire ou lire directement dans le buffer vidéo comme
  3316. ci-dessous :
  3317.  
  3318. Exemple :
  3319.  
  3320.             call Init_Vesa_Bank         ; Mise en place de la commutation
  3321.             jc Error_Sel                ; automatique des banks
  3322.  
  3323.             mov es,bx                   ; Positionnement de ES:EDI sur le
  3324.             xor edi,edi                 ; buffer vidéo
  3325.  
  3326.             mov esi,[Addr_Pic]          ; Positionnement de DE:ESI sur Addr_Pic
  3327.  
  3328.             xor edx,edx
  3329.             call Set_Bank               ; Sélection du premier bank
  3330.  
  3331.             mov ecx,640*(480/4)
  3332.             rep movsd                   ; Commutation auto des autres banks
  3333.  
  3334.  
  3335. Explication :
  3336.  
  3337. En principe, pour accéder à la totalité de la RAM vidéo, vous êtes obligé de
  3338. commuter manuellement les banks :
  3339.  
  3340.             mov esi,Adresse_de_mon_image
  3341.  
  3342.             mov edx,0
  3343.             call set_bank
  3344.             mov ecx,64k
  3345.             mov edi,0
  3346.             rep movsd
  3347.  
  3348.             mov edx,1
  3349.             call set_bank
  3350.             mov ecx,64k
  3351.             mov edi,0
  3352.             rep movsd
  3353.  
  3354.             etc..
  3355.  
  3356. Cette manipulation est possible avec l'E.O.S et très facile à réaliser pour
  3357. une image. Par contre pour des sprites qui se déplacent à l'écran cela
  3358. devient très vite plus difficile car le changement de bank peut survenir à
  3359. n'importe quel instant. A chaque pixel il faut donc faire un test ce qui
  3360. empêche l'utilisation d'instruction comme rep movsd. Inutile de vous dire
  3361. que c'est aussi très lent. Avec la commutation automatique de l'E.O.S,
  3362. il vous suffit d'indiquer le premier bank. Lorsqu'un changement de bank
  3363. doit avoir lieu, par exemple au milieu d'une instruction rep movsd l'E.O.S
  3364. commute le bank suivant et repositione le registre EDI et l'instruction
  3365. peut alors se poursuivre. Cette méthode est extrêmement rapide et permet
  3366. de travailler linéairement sans faire un seul test pour changer de bank.
  3367.  
  3368. Attention !
  3369.  
  3370. La valeur de EDI dans la routine suivante n'est pas égale
  3371. à 65535+4 mais à 00000+3.
  3372.  
  3373.             ...
  3374.             mov edi,65535
  3375.             stosd
  3376.             ...                 ; EDI = 3 !!!
  3377.  
  3378.  
  3379. Lorsque E.O.S change de bank, il change aussi la valeur de EDI :
  3380.  
  3381.             00000 Bank 1
  3382.             65535           ; edi=65535, bank= 1
  3383.             65536 Bank 2    ; edi=00000, bank= 2
  3384.  
  3385.  
  3386. Restrictions : En lecture, seul les instructions Lodsb, Lodsw et Lodsd
  3387. sont supportées.
  3388.  
  3389. Pour que le système de commutation fonctionne correctement, il faut donc
  3390. respecter les quatres règles suivantes :
  3391.  
  3392.             1 - Positionner manuellement le premier bank.
  3393.             2 - Ecrire dans le buffer vidéo de haut en bas.
  3394.             3 - Prendre en compte le fait que l'EOS peut modifier
  3395.                 EDI ou ESI.
  3396.             4 - Utiliser uniquement Lodsb, Lodsw et Lodsd pour lire dans
  3397.                 le buffer vidéo.
  3398.  
  3399.  
  3400. ───────────────────────────────────────────────────────────────────────────────
  3401. Linear Frame Buffer en VESA 2.0
  3402. ───────────────────────────────────────────────────────────────────────────────
  3403.  
  3404. En VESA 2.0, l'E.O.S permet d'accéder à un buffer linéaire fictif qui
  3405. correspond directement à la mémoire de votre carte graphique. Lorsque vous
  3406. écrivez dans ce buffer, l'information est instantanément écrite dans la ram de
  3407. la carte vidéo par un système de redirection d'adresse. Le buffer vidéo
  3408. fictif ne prend donc aucune place en mémoire RAM puisqu'il est l'image directe
  3409. de la mémoire vidéo.
  3410.  
  3411. Exemple :
  3412.  
  3413.             mov eax,Mode640x480x256 ; Init SVGA Mode
  3414.             mov ecx,640*480         ; Linear Buffer Size
  3415.             call Init_Vesa2
  3416.             jc Error_Vesa
  3417.             mov [Buffer],eax        ; Linear Buffer Address
  3418.  
  3419.             ...
  3420.  
  3421.             mov edi,[Buffer]
  3422.             mov ecx,(640/4)*480
  3423.             rep movsd
  3424.  
  3425.  
  3426. Cette méthode est beaucoup plus pratique que la commutation de
  3427. bank car les registres du processeur ne sont pas modifiés. Malheureusement,
  3428. ce système nécessite une carte vidéo très récente car le Linear Frame
  3429. Buffer est réalisé en hard par celle-ci.
  3430.  
  3431.  
  3432. ╔══════════════════════════════════════════════════════════════════════════╗
  3433. ║                                                                          ║
  3434. ║ Les fonctions de la librairie VESA                                       ║
  3435. ║                                                                          ║
  3436. ╚══════════════════════════════════════════════════════════════════════════╝
  3437.  
  3438. ┌───────────────┐
  3439. │Init Vesa      │
  3440. │Init Vesa2     │
  3441. │Init Vesa Bank │
  3442. │Close Vesa Bank│
  3443. │Set Bank       │
  3444. └───────────────┘
  3445.  
  3446. ┌──────────────────────────────────────────────────────────────────────────┐
  3447. │Init Vesa   Initialize A Vesa 1.x or 2.0 to use automatic bank switching  │
  3448. │                                                                          │
  3449. │In :                                                                      │
  3450. │        EAX = Vesa mode                                                   │
  3451. │                                                                          │
  3452. │Out :                                                                     │
  3453. │        EAX = VRAM address                                                │
  3454. │                                                                          │
  3455. │        Carry = 0                                                         │
  3456. │             All Done                                                     │
  3457. │                                                                          │
  3458. │        Carry = 1                                                         │
  3459. │             Mode Vesa not supported or Vesa driver not found             │
  3460. │                                                                          │
  3461. └──────────────────────────────────────────────────────────────────────────┘
  3462.  
  3463. Exemple :
  3464.             mov eax,Mode640x480x256
  3465.             call Init_Vesa
  3466.             jc Error_Vesa
  3467.  
  3468.             ...
  3469.  
  3470. Vesa_Txt            db '    ■ Mode SVGA not supported or VESA not found !',13,10
  3471.                     db '      To install a vesa driver, refer to your video card documentation.',13,10,36
  3472.  
  3473.  
  3474. ┌──────────────────────────────────────────────────────────────────────────┐
  3475. │Init Vesa2  Initialize A Vesa 2.0 to use linear frame buffer              │
  3476. │                                                                          │
  3477. │In :                                                                      │
  3478. │        EAX = Vesa mode                                                   │
  3479. │        ECX = Video buffer size                                           │
  3480. │                                                                          │
  3481. │Out :                                                                     │
  3482. │        EAX = Linear buffer address                                       │
  3483. │                                                                          │
  3484. │        Carry = 0                                                         │
  3485. │             All Done                                                     │
  3486. │                                                                          │
  3487. │        Carry = 1                                                         │
  3488. │             Mode Vesa not supported or Vesa driver not found             │
  3489. │                                                                          │
  3490. └──────────────────────────────────────────────────────────────────────────┘
  3491.  
  3492. Exemple :
  3493.             mov eax,Mode640x480x256
  3494.             mov ecx,640*480
  3495.             call Init_Vesa2
  3496.             jc Error_Vesa
  3497.             mov [Screen],eax
  3498.  
  3499.             ...
  3500.  
  3501. Vesa_Txt            db '    ■ Mode SVGA not supported or VESA not found !',13,10
  3502.                     db '      To install a vesa driver, refer to your video card documentation.',13,10,36
  3503.  
  3504.  
  3505. ┌──────────────────────────────────────────────────────────────────────────┐
  3506. │Init Vesa Bank   Init the Automatic Bank Switching                        │
  3507. │                                                                          │
  3508. │In :                                                                      │
  3509. │                                                                          │
  3510. │Out :                                                                     │
  3511. │        Carry = 0                                                         │
  3512. │             All Done                                                     │
  3513. │       BX = New selector for addressing the video ram                     │
  3514. │                                                                          │
  3515. │        Carry = 1                                                         │
  3516. │             Can't allocate selector                                      │
  3517. │                                                                          │
  3518. └──────────────────────────────────────────────────────────────────────────┘
  3519.  
  3520. Exemple :
  3521.             call Init_Vesa_Bank
  3522.             jc Error_Sel
  3523.             mov [screen_selector],bx
  3524.  
  3525.  
  3526. ┌──────────────────────────────────────────────────────────────────────────┐
  3527. │Close Vesa Bank  Close the Automatic Bank Switching                       │
  3528. │                                                                          │
  3529. │In :                                                                      │
  3530. │                                                                          │
  3531. │Out :                                                                     │
  3532. │                                                                          │
  3533. │                                                                          │
  3534. └──────────────────────────────────────────────────────────────────────────┘
  3535.  
  3536. Exemple :
  3537.             call Close_Vesa_Bank
  3538.  
  3539.  
  3540. ┌──────────────────────────────────────────────────────────────────────────┐
  3541. │Set Bank         Select the first Bank                                    │
  3542. │                                                                          │
  3543. │In :                                                                      │
  3544. │                                                                          │
  3545. │Out :                                                                     │
  3546. │                                                                          │
  3547. │                                                                          │
  3548. └──────────────────────────────────────────────────────────────────────────┘
  3549.  
  3550. Exemple :
  3551.             mov edx,edi     ; EDI Address of first pixel to be display
  3552.             shr edx,16
  3553.             call Set_Bank
  3554.             and edi,0ffffh
  3555.  
  3556.  
  3557. ╔══════════════════════════════════════════════════════════════════════════╗
  3558. ║                                                                          ║
  3559. ║ Les variables de la librairie VESA                                       ║
  3560. ║                                                                          ║
  3561. ╚══════════════════════════════════════════════════════════════════════════╝
  3562.  
  3563. ┌─────────────────────┐
  3564. │Vesa Clear Palette   │
  3565. └─────────────────────┘
  3566.  
  3567. ┌──────────────────────────────────────────────────────────────────────────┐
  3568. │Vesa Clear Palette   Toggle clear palette on/off                          │
  3569. │                                                                          │
  3570. │In :                                                                      │
  3571. │                                                                          │
  3572. │Out :                                                                     │
  3573. │                                                                          │
  3574. └──────────────────────────────────────────────────────────────────────────┘
  3575.  
  3576. Exemple :
  3577.             mov vesa_clear_palette,off  ; Default = On
  3578.             call Init_Vesa_Bank
  3579.             jc Error_Sel
  3580.             mov [screen_selector],bx
  3581.  
  3582.  
  3583. ╔══════════════════════════════════════════════════════════════════════════╗
  3584. ║                                                                          ║
  3585. ║ Les déclarations de la librairie VESA                                    ║
  3586. ║                                                                          ║
  3587. ╚══════════════════════════════════════════════════════════════════════════╝
  3588.  
  3589. ───────────────────────────────────────────────────────────────────────────────
  3590. VBE v1.0
  3591. ───────────────────────────────────────────────────────────────────────────────
  3592.  
  3593. Mode640x400x256             = 100h
  3594. Mode640x480x256             = 101h
  3595. Mode800x600x16              = 102h
  3596. Mode800x600x256             = 103h
  3597. Mode1024x768x16             = 104h
  3598. Mode1024x768x256            = 105h
  3599. Mode1280x1024x16            = 106h
  3600. Mode1280x1024x256           = 107h
  3601. Mode80x60                   = 108h
  3602. Mode132x25                  = 109h
  3603. Mode132x43                  = 10ah
  3604. Mode132x60                  = 10bh
  3605. Mode132x60                  = 10ch
  3606.  
  3607.  
  3608. ───────────────────────────────────────────────────────────────────────────────
  3609. VBE v1.2+
  3610. ───────────────────────────────────────────────────────────────────────────────
  3611.  
  3612. Mode320x200x32k             = 10dh
  3613. Mode320x200x64k             = 10eh
  3614. Mode320x200x16M             = 10fh
  3615. Mode640x480x32k             = 110h
  3616. Mode640x480x64k             = 111h
  3617. Mode640x480x16M             = 112h
  3618. Mode800x600x32k             = 113h
  3619. Mode800x600x64k             = 114h
  3620. Mode800x600x16M             = 115h
  3621. Mode1024x768x32k            = 116h
  3622. Mode1024x768x64k            = 117h
  3623. Mode1024x768x16M            = 118h
  3624. Mode1280x1024x32k           = 119h
  3625. Mode1280x1024x64k           = 11ah
  3626. Mode1280x1024x16M           = 11bh
  3627.  
  3628.  
  3629. ╔══════════════════════════════════════════════════════════════════════════╗
  3630. ║                                                                          ║
  3631. ║ La librairie FLI32                                                       ║
  3632. ║                                                                          ║
  3633. ╚══════════════════════════════════════════════════════════════════════════╝
  3634.  
  3635. Cette librairie permet d'utiliser des fichiers 3D précalculé au format FLI
  3636. ou FLC dans vos programmes.
  3637.  
  3638.  
  3639. ╔══════════════════════════════════════════════════════════════════════════╗
  3640. ║                                                                          ║
  3641. ║ Les fonctions de la librairie FLI32                                      ║
  3642. ║                                                                          ║
  3643. ╚══════════════════════════════════════════════════════════════════════════╝
  3644.  
  3645. ┌─────────────────┐
  3646. │Load Fli         │
  3647. │Load Internal Fli│
  3648. │First Frame Fli  │
  3649. │Next Frame Fli   │
  3650. │Dispose Fli      │
  3651. └─────────────────┘
  3652.  
  3653. ┌──────────────────────────────────────────────────────────────────────────┐
  3654. │Play a FLI/FLC files                                                      │
  3655. │                                                                          │
  3656. │Functions :                                                               │
  3657. │                                                                          │
  3658. │        Load_Fli          Load a FLI into the memory                      │
  3659. │                          Initialize if needed the track-disk mode        │
  3660. │                          Check the header                                │
  3661. │                                                                          │
  3662. │        Load_Internal_Fli Load a FLI which is link with LLINK             │
  3663. │                          Check the header                                │
  3664. │                                                                          │
  3665. │        First_Frame_Fli   Uncompress the first frame                      │
  3666. │                                                                          │
  3667. │        Next_Frame_Fli    Uncompress next frame                           │
  3668. │                                                                          │
  3669. │        Dispose_Fli       Freeing memory                                  │
  3670. │                          Close File                                      │
  3671. │                                                                          │
  3672. │Information During playing :                                              │
  3673. │                                                                          │
  3674. │        Fli_Err       = 1 - Chunk not found                               │
  3675. │                        2 - Out of memory                                 │
  3676. │                        3 - File error                                    │
  3677. │                        4 - Bad FLC header                                │
  3678. │                        5 - Size max for FLC : 640x480                    │
  3679. │                                                                          │
  3680. │        Fli_Swap      = On - Track disk running -  not enough memory to   │
  3681. │                             load the file                                │
  3682. │                        Off- File has been load into memory               │
  3683. │                                                                          │
  3684. │        Fli_Svga      = On - Number of Lines >200                         │
  3685. │                                                                          │
  3686. │        Fli_Delay     = Fli speed                                         │
  3687. │                                                                          │
  3688. │        Fli_Last_Frame= On - Last frame (Mode No looping)                 │
  3689. │                                                                          │
  3690. │        Fli_Current_Frame = Current frame                                 │
  3691. │                                                                          │
  3692. │Commands :                                                                │
  3693. │                                                                          │
  3694. │        Fli_Selector  = Screen selector                                   │
  3695. │                                                                          │
  3696. │        Fli_ReStart   = On - Restart at the begining of the animation     │
  3697. │                                                                          │
  3698. │        Fli_Loop      = On - Restart the FLI at the end (Defaults)        │
  3699. │                        Off- Stop at the end  (Mode No looping)           │
  3700. │                                                                          │
  3701. │        Fli_TrackDisk = On - Enable Track-Disk mode                       │
  3702. │                        Off- Track-Disk not use execpt when the FLI can't │
  3703. │                             be load into the memory                      │
  3704. │                                                                          │
  3705. │        Fli_Buffer    = Logical address of FLI buffer                     │
  3706. │                                                                          │
  3707. │        Fli_Ligne_Shl = 6 for  320 per line                               │
  3708. │                        7 for  640 per line                               │
  3709. │                                                                          │
  3710. │        Fli_Scr_X     = Number of pixel per line                          │
  3711. │        Fli_Scr_Y     = Number of lines                                   │
  3712. │                                                                          │
  3713. │        Fli_Decal_X   = Number of pixel per line                          │
  3714. │        Fli_Decal_Y   = Number of lines                                   │
  3715. │                                                                          │
  3716. └──────────────────────────────────────────────────────────────────────────┘
  3717.  
  3718. Exemple :
  3719.             mov edx, offset Fli_Path
  3720.             call Load_Fli
  3721.             jc Fli_Error
  3722.  
  3723.             cmp Fli_Svga,On
  3724.             je  @@Init_Svga
  3725.             jne @@Init_Vga
  3726.  
  3727.             ...
  3728.  
  3729.             mov Fli_Selector,[screen_selector]
  3730.  
  3731.             call First_Frame_Fli
  3732.             jc Fli_Error
  3733.  
  3734. @@again:
  3735.             mov ah,Wait_Vbl
  3736.             Int_EOS
  3737.  
  3738.             call Next_Frame_Fli
  3739.             jc Fli_Error
  3740.  
  3741.             cmp Key_Map[Escape],On
  3742.             jne @@again
  3743.  
  3744.  
  3745. ╔══════════════════════════════════════════════════════════════════════════╗
  3746. ║                                                                          ║
  3747. ║ La librairie SNAP                                                        ║
  3748. ║                                                                          ║
  3749. ╚══════════════════════════════════════════════════════════════════════════╝
  3750.  
  3751. Cette librairie permet de réaliser des hard-copy d'écran VESA au format IFF
  3752. à l'aide de la touche Arrêt_défil.
  3753.  
  3754.  
  3755. ╔══════════════════════════════════════════════════════════════════════════╗
  3756. ║                                                                          ║
  3757. ║ Les fonctions de la librairie SNAP                                       ║
  3758. ║                                                                          ║
  3759. ╚══════════════════════════════════════════════════════════════════════════╝
  3760.  
  3761. ┌─────────┐
  3762. │Init Snap│
  3763. │Snap IFF │
  3764. │Save IFF │
  3765. └─────────┘
  3766.  
  3767. ┌──────────────────────────────────────────────────────────────────────────┐
  3768. │Init Snap   Initialize the screen grabber . (You can change the int 09    │
  3769. │            function Use_Int_09 after this Init                           │
  3770. │                                                                          │
  3771. │In :                                                                      │
  3772. │                                                                          │
  3773. │Out :                                                                     │
  3774. │                                                                          │
  3775. └──────────────────────────────────────────────────────────────────────────┘
  3776.  
  3777. Exemple :
  3778.             mov ah,Use_Int_09
  3779.             mov bx,On
  3780.             Int_EOS
  3781.  
  3782.             call Init_Snap
  3783.  
  3784.  
  3785. ┌──────────────────────────────────────────────────────────────────────────┐
  3786. │Snap IFF    Grab the current Screen from Video RAM                        │
  3787. │                                                                          │
  3788. │In :                                                                      │
  3789. │                                                                          │
  3790. │Out :                                                                     │
  3791. │                                                                          │
  3792. └──────────────────────────────────────────────────────────────────────────┘
  3793.  
  3794. Exemple :
  3795.             call Snap_IFF
  3796.  
  3797.  
  3798. ┌──────────────────────────────────────────────────────────────────────────┐
  3799. │Save IFF    Save a buffer to IFF                                          │
  3800. │                                                                          │
  3801. │In :                                                                      │
  3802. │        AX = Screen Size X                                                │
  3803. │        BX = Screen Size Y                                                │
  3804. │       EDX = Offset of File Name                                          │
  3805. │       ESI = Address to save in IFF                                       │
  3806. │                                                                          │
  3807. │Out :                                                                     │
  3808. │                                                                          │
  3809. └──────────────────────────────────────────────────────────────────────────┘
  3810.  
  3811. Exemple :
  3812.             mov ax,640
  3813.             mov bx,480
  3814.             mov edx,O File_Name
  3815.             mov esi,Buffer
  3816.             call Save_IFF
  3817.  
  3818.  
  3819. ╔══════════════════════════════════════════════════════════════════════════╗
  3820. ║                                                                          ║
  3821. ║ La librairie JOYSTICK                                                    ║
  3822. ║                                                                          ║
  3823. ╚══════════════════════════════════════════════════════════════════════════╝
  3824.  
  3825. Cette librairie permet de gérer des manettes de jeux.
  3826.  
  3827.  
  3828. ╔══════════════════════════════════════════════════════════════════════════╗
  3829. ║                                                                          ║
  3830. ║ Les fonctions de la librairie JOYSTICK                                   ║
  3831. ║                                                                          ║
  3832. ╚══════════════════════════════════════════════════════════════════════════╝
  3833.  
  3834. ┌────────────────┐
  3835. │Init Joystick   │
  3836. │Dectect Joystick│
  3837. │Add Joystick    │
  3838. │Update Joystick │
  3839. │Sub Joystick    │
  3840. │Upper Left      │
  3841. │Lower Right     │
  3842. │Center          │
  3843. └────────────────┘
  3844.  
  3845. ┌──────────────────────────────────────────────────────────────────────────┐
  3846. │Init_Joystick  Initialize all port en address                             │
  3847. │                                                                          │
  3848. │In :                                                                      │
  3849. │                                                                          │
  3850. │Out :                                                                     │
  3851. │                                                                          │
  3852. │Other Registers Change : None                                             │
  3853. │                                                                          │
  3854. └──────────────────────────────────────────────────────────────────────────┘
  3855.  
  3856. Exemple :
  3857.             call Init_Joystick
  3858.  
  3859.  
  3860. ┌──────────────────────────────────────────────────────────────────────────┐
  3861. │Dectect_Joystick  Find if a analogic joystick is plug in port 1 ,2 or Both│
  3862. │                                                                          │
  3863. │In :                                                                      │
  3864. │                                                                          │
  3865. │Out :                                                                     │
  3866. │        Carry = 0                                                         │
  3867. │             All Done                                                     │
  3868. │       EAX = 1 A joystick is plug in port 1                               │
  3869. │             2 A joystick is plug in port 2                               │
  3870. │             3 2 joystick is plug in port 1 and 2                         │
  3871. │                                                                          │
  3872. │        Carry = 1                                                         │
  3873. │             No Joystick                                                  │
  3874. │                                                                          │
  3875. │Other Registers Change : None                                             │
  3876. │                                                                          │
  3877. └──────────────────────────────────────────────────────────────────────────┘
  3878.  
  3879. Exemple :
  3880.             call Detect_Joystick
  3881.             test eax,Analog_A
  3882.             je @@Ok1
  3883.             ...
  3884. @@Ok1:
  3885.             test eax,Analog_B
  3886.             je @@Ok3
  3887.             ...
  3888. @@Ok3:
  3889.  
  3890.  
  3891. ┌──────────────────────────────────────────────────────────────────────────┐
  3892. │Add_Joystick   Add a new joystick to be use by the library                │
  3893. │                                                                          │
  3894. │In :                                                                      │
  3895. │        AX = Type Of joystick                                             │
  3896. │             Analog_A                                                     │
  3897. │             Analog_B                                                     │
  3898. │             Lpt_A                                                        │
  3899. │             Lpt_B                                                        │
  3900. │        BX = Address of port                                              │
  3901. │           = 1 Lpt1                                                       │
  3902. │           = 2 Lpt2                                                       │
  3903. │           = 3 Lpt3                                                       │
  3904. │           = 4 Lpt4                                                       │
  3905. │                                                                          │
  3906. │Out :                                                                     │
  3907. │        Carry = 0                                                         │
  3908. │             All Done                                                     │
  3909. │       ESI = Address of structure of joystick                             │
  3910. │                                                                          │
  3911. │        Carry = 1                                                         │
  3912. │             No Joystick Available                                        │
  3913. │                                                                          │
  3914. │Other Registers Change : None                                             │
  3915. │                                                                          │
  3916. └──────────────────────────────────────────────────────────────────────────┘
  3917.  
  3918. Exemple :
  3919.             mov ax,Analog_A
  3920.             call Add_Joystick
  3921.             jc No_Joystick_Available
  3922.  
  3923.  
  3924. ┌──────────────────────────────────────────────────────────────────────────┐
  3925. │Update_Joystick  Must be call often update all structure of all Joystick  │
  3926. │                 declare with Add_Joystick                                │
  3927. │                                                                          │
  3928. │In :                                                                      │
  3929. │                                                                          │
  3930. │Out :                                                                     │
  3931. │                                                                          │
  3932. │Other Registers Change : None                                             │
  3933. │                                                                          │
  3934. └──────────────────────────────────────────────────────────────────────────┘
  3935.  
  3936. Exemple :
  3937.             call Update_Joystick
  3938.  
  3939.  
  3940. ┌──────────────────────────────────────────────────────────────────────────┐
  3941. │Sub_Joystick   Delete a Joystick create by Add_Joystick                   │
  3942. │                                                                          │
  3943. │In :                                                                      │
  3944. │       ESI = Address of structure to be delete                            │
  3945. │                                                                          │
  3946. │Out :                                                                     │
  3947. │        Carry = 0                                                         │
  3948. │             All Done                                                     │
  3949. │                                                                          │
  3950. │        Carry = 1                                                         │
  3951. │             Structure not found                                          │
  3952. │                                                                          │
  3953. │Other Registers Change : None                                             │
  3954. │                                                                          │
  3955. └──────────────────────────────────────────────────────────────────────────┘
  3956.  
  3957. Exemple :
  3958.             mov esi,[Addr_Joy1]
  3959.             call Sub_Joystick
  3960.             jc Structure_Not_Found
  3961.  
  3962.  
  3963. ┌──────────────────────────────────────────────────────────────────────────┐
  3964. │Upper_Left     Take Value For Upper Left Joystick's Coordonate            │
  3965. │                                                                          │
  3966. │In :                                                                      │
  3967. │       ESI = Address of structure                                         │
  3968. │                                                                          │
  3969. │Out :                                                                     │
  3970. │        Carry = 0                                                         │
  3971. │             All Done                                                     │
  3972. │                                                                          │
  3973. │        Carry = 1                                                         │
  3974. │             No Fire Press                                                │
  3975. │                                                                          │
  3976. │                                                                          │
  3977. │Other Registers Change : None                                             │
  3978. │                                                                          │
  3979. └──────────────────────────────────────────────────────────────────────────┘
  3980.  
  3981. Exemple :
  3982.  
  3983. @@Loop:
  3984.             mov esi,[Addr_Joy1]
  3985.             call Upper_Left
  3986.             jc @@Loop
  3987.  
  3988.  
  3989. ┌──────────────────────────────────────────────────────────────────────────┐
  3990. │Lower_Right    Take Value For Lower Right Joystick's Coordonate           │
  3991. │                                                                          │
  3992. │In :                                                                      │
  3993. │       ESI = Address of structure                                         │
  3994. │                                                                          │
  3995. │Out :                                                                     │
  3996. │        Carry = 0                                                         │
  3997. │             All Done                                                     │
  3998. │                                                                          │
  3999. │        Carry = 1                                                         │
  4000. │             No Fire Press                                                │
  4001. │                                                                          │
  4002. │                                                                          │
  4003. │Other Registers Change : None                                             │
  4004. │                                                                          │
  4005. └──────────────────────────────────────────────────────────────────────────┘
  4006.  
  4007. Exemple :
  4008.  
  4009. @@Loop:
  4010.             mov esi,[Addr_Joy1]
  4011.             call Lower_Right
  4012.             jc @@Loop
  4013.  
  4014.  
  4015. ┌──────────────────────────────────────────────────────────────────────────┐
  4016. │Center         Take Value For Center Joystick's Coordonate                │
  4017. │                                                                          │
  4018. │In :                                                                      │
  4019. │       ESI = Address of structure                                         │
  4020. │                                                                          │
  4021. │Out :                                                                     │
  4022. │        Carry = 0                                                         │
  4023. │             All Done                                                     │
  4024. │                                                                          │
  4025. │        Carry = 1                                                         │
  4026. │             No Fire Press                                                │
  4027. │                                                                          │
  4028. │                                                                          │
  4029. │Other Registers Change : None                                             │
  4030. │                                                                          │
  4031. └──────────────────────────────────────────────────────────────────────────┘
  4032.  
  4033. Exemple :
  4034.  
  4035. @@Loop:
  4036.             mov esi,[Addr_Joy1]
  4037.             call Center
  4038.             jc @@Loop
  4039.  
  4040.  
  4041. ╔══════════════════════════════════════════════════════════════════════════╗
  4042. ║                                                                          ║
  4043. ║ Les déclarations de la librairie JOYSTICK                                ║
  4044. ║                                                                          ║
  4045. ╚══════════════════════════════════════════════════════════════════════════╝
  4046.  
  4047. Analog_A        = 1h
  4048. Analog_B        = 2h
  4049. Lpt_A           = 10h
  4050. Lpt_B           = 20h
  4051.  
  4052. Lpt1            = 1h
  4053. Lpt2            = 2h
  4054. Lpt3            = 3h
  4055. Lpt4            = 4h
  4056.  
  4057. Joy             Struc
  4058. J_Type          dw 0
  4059. J_Addr          dw 0
  4060. J_Min_X         dw 0
  4061. J_Max_X         dw 0
  4062. J_Min_Y         dw 0
  4063. J_Max_Y         dw 0
  4064. J_Center_X      dw 0
  4065. J_Center_Y      dw 0
  4066. J_Left          db 0
  4067. J_Right         db 0
  4068. J_Up            db 0
  4069. J_Down          db 0
  4070. J_Fire1         db 0
  4071. J_Fire2         db 0
  4072. J_Fire3         db 0
  4073. J_Fire4         db 0
  4074. Joy             ends
  4075.  
  4076.  
  4077. ╔══════════════════════════════════════════════════════════════════════════╗
  4078. ║                                                                          ║
  4079. ║ La librairie mémoire                                                     ║
  4080. ║                                                                          ║
  4081. ╚══════════════════════════════════════════════════════════════════════════╝
  4082.  
  4083. Cette librairie affiche la mémoire disponible en temps réel sur l'écran
  4084. monochrome.
  4085.  
  4086.  
  4087. ╔══════════════════════════════════════════════════════════════════════════╗
  4088. ║                                                                          ║
  4089. ║ Les fonctions de la librairie mémoire                                    ║
  4090. ║                                                                          ║
  4091. ╚══════════════════════════════════════════════════════════════════════════╝
  4092.  
  4093. ┌───────────┐
  4094. │Init Memory│
  4095. └───────────┘
  4096.  
  4097. ┌──────────────────────────────────────────────────────────────────────────┐
  4098. │Init_Memory    Turn the display memory on                                 │
  4099. │                                                                          │
  4100. │In :                                                                      │
  4101. │                                                                          │
  4102. │Out :                                                                     │
  4103. │                                                                          │
  4104. │Other Registers Change : None                                             │
  4105. │                                                                          │
  4106. └──────────────────────────────────────────────────────────────────────────┘
  4107.  
  4108. Exemple :
  4109.             call Init_Memory
  4110.  
  4111.  
  4112. ╔══════════════════════════════════════════════════════════════════════════╗
  4113. ║                                                                          ║
  4114. ║ Les fonctions du DPMI (interruption 31h) supportées par l'E.O.S          ║
  4115. ║                                                                          ║
  4116. ╚══════════════════════════════════════════════════════════════════════════╝
  4117.  
  4118. Les fonctions DPMI suivantes ne sont disponibles que pour les personnes qui
  4119. utilisent les versions WEOS.EXE, WEOSLITE.EXE ou WDEBUG.EXE. C'est à dire
  4120. les programmeurs Watcom (C++ ou Assembleur).
  4121.  
  4122. Function 0000h - Allocate LDT Descriptors
  4123. Function 0001h - Free LDT Descriptor
  4124. Function 0002h - Segment to Descriptor
  4125. Function 0003h - Get Next Selector Increment Value
  4126. Function 0006h - Get Segment Base Address
  4127. Function 0007h - Set Segment Base Address
  4128. Function 0008h - Set Segment Limit
  4129. Function 0009h - Set Descriptor Access Rights
  4130. Function 000Ah - Create Code Segment Alias Descriptor
  4131. Function 000Bh - Get Descriptor
  4132. Function 000Ch - Set Descriptor
  4133. Function 0100h - Allocate DOS Memory Block
  4134. Function 0101h - Free DOS Memory Block
  4135. Function 0102h - Resize DOS Memory Block
  4136. Function 0200h - Get Real Mode Interrupt Vector
  4137. Function 0201h - Set Real Mode Interrupt Vector
  4138. Function 0202h - Get Processor Exception Handler Vector
  4139. Function 0203h - Set Processor Exception Handler Vector
  4140. Function 0204h - Get Protected Mode Interrupt Vector
  4141. Function 0205h - Set Protected Mode Interrupt Vector
  4142. Function 0300h - Simulate Real Mode Interrupt
  4143. Function 0301h - Call Real Mode Procedure With Far Return Frame
  4144. Function 0302h - Call Real Mode Procedure With Iret Frame
  4145. Function 0400h - Get Version
  4146. Function 0500h - Get Free Memory Information
  4147. Function 0501h - Allocate Memory Block
  4148. Function 0502h - Free Memory Block
  4149. Function 0503h - Resize Memory Block
  4150. Function 0800h - Physical Address Mapping
  4151. Function 0900h - Get and Disable Virtual Interrupt State
  4152. Function 0901h - Get and Enable Virtual Interrupt State
  4153. Function 0902h - Get Virtual Interrupt State
  4154.  
  4155.  
  4156. ───────────────────────────────────────────────────────────────────────────────
  4157. Function 0000h - Allocate LDT Descriptors
  4158. ───────────────────────────────────────────────────────────────────────────────
  4159.  
  4160. In:
  4161.  
  4162.         AX = 0000h
  4163.         CX = Number of descriptors to allocate
  4164.  
  4165. Out:
  4166.  
  4167.        Carry = 0 if successful
  4168.         AX = Base selector
  4169.  
  4170.  
  4171. ───────────────────────────────────────────────────────────────────────────────
  4172. Function 0001h - Free LDT Descriptor
  4173. ───────────────────────────────────────────────────────────────────────────────
  4174.  
  4175. In:
  4176.  
  4177.         AX = 0001h
  4178.         BX = Selector to free
  4179.  
  4180. Out:
  4181.  
  4182.        Carry = 0 if successful
  4183.  
  4184.  
  4185. ───────────────────────────────────────────────────────────────────────────────
  4186. Function 0002h - Segment to Descriptor
  4187. ───────────────────────────────────────────────────────────────────────────────
  4188.  
  4189. In:
  4190.  
  4191.         AX = 0002h
  4192.         BX = Real mode segment address
  4193.  
  4194. Out:
  4195.        Carry = 0 if successful
  4196.         AX = Selector mapped to real mode segment
  4197.  
  4198.  
  4199. ───────────────────────────────────────────────────────────────────────────────
  4200. Function 0003h - Get Next Selector Increment Value
  4201. ───────────────────────────────────────────────────────────────────────────────
  4202.  
  4203. In:
  4204.  
  4205.         AX = 0003h
  4206.  
  4207. Out:
  4208.  
  4209.        Carry = 0
  4210.         AX = Value to add to get to next selector
  4211.  
  4212.  
  4213. ───────────────────────────────────────────────────────────────────────────────
  4214. Function 0006h - Get Segment Base Address
  4215. ───────────────────────────────────────────────────────────────────────────────
  4216.  
  4217. In:
  4218.  
  4219.         AX = 0006h
  4220.         BX = Selector
  4221.  
  4222. Out:
  4223.  
  4224.        Carry = 0 if successful
  4225.         CX:DX = 32-bit linear base address of segment
  4226.  
  4227.  
  4228. ───────────────────────────────────────────────────────────────────────────────
  4229. Function 0007h - Set Segment Base Address
  4230. ───────────────────────────────────────────────────────────────────────────────
  4231.  
  4232. In:
  4233.  
  4234.         AX = 0007h
  4235.         BX = Selector
  4236.         CX:DX = 32-bit linear base address for segment
  4237.  
  4238. Out:
  4239.  
  4240.        Carry = 0 if successful
  4241.  
  4242.  
  4243. ───────────────────────────────────────────────────────────────────────────────
  4244. Function 0008h - Set Segment Limit
  4245. ───────────────────────────────────────────────────────────────────────────────
  4246.  
  4247. In:
  4248.  
  4249.         AX = 0008h
  4250.         BX = Selector
  4251.         CX:DX = 32-bit segment limit
  4252.  
  4253. Out:
  4254.        Carry = 0 if successful
  4255.  
  4256.  
  4257. ───────────────────────────────────────────────────────────────────────────────
  4258. Function 0009h - Set Descriptor Access Rights
  4259. ───────────────────────────────────────────────────────────────────────────────
  4260.  
  4261. In:
  4262.  
  4263.         AX = 0009h
  4264.         BX = Selector
  4265.         CX = rights/type word
  4266.  
  4267.  
  4268. Out:
  4269.        Carry = 0 if successful
  4270.  
  4271. Notes:
  4272.     The access rights/type word passed to the function in CX has
  4273.     the following format :
  4274.  
  4275.     Bit: 15  14  13  12  11  10   9   8   7   6   5   4   3   2   1   0
  4276.        ┌───┬───┬───┬───┬───────────────┬───┬───────┬───┬───┬───┬───┬───┐
  4277.        │ G │B/D│ 0 │ 0 │       0       │ 1 │  DPL  │ 1 │C/D│E/C│W/R│ A │
  4278.        └───┴───┴───┴───┴───────────────┴───┴───────┴───┴───┴───┴───┴───┘
  4279.  
  4280.     G  h - 0=byte granular, 1=page granular
  4281.     B/Dh - 0=default 16bit, 1=default 32bit
  4282.     DPLh - must be equal to caller's CPL
  4283.     C/Dh - 0=data, 1=code
  4284.     E/Ch - data: 0=expand-up, 1=expand-down
  4285.           code: must be 0 (non-conforming)
  4286.     W/Rh - data: 0=read, 1=read/write
  4287.           code: must be 1 (readable)
  4288.     A  h - 0=not accessed, 1=accessed
  4289.  
  4290.  
  4291. ───────────────────────────────────────────────────────────────────────────────
  4292. Function 000Ah - Create Code Segment Alias Descriptor
  4293. ───────────────────────────────────────────────────────────────────────────────
  4294.  
  4295. In:
  4296.  
  4297.         AX = 000Ah
  4298.         BX = Code segment selector
  4299.  
  4300. Out:
  4301.        Carry = 0 if successful
  4302.         AX = New data selector
  4303.  
  4304.  
  4305. ───────────────────────────────────────────────────────────────────────────────
  4306. Function 000Bh - Get Descriptor
  4307. ───────────────────────────────────────────────────────────────────────────────
  4308.  
  4309. In:
  4310.  
  4311.         AX = 000Bh
  4312.         BX = Selector
  4313.         ES:EDI = Pointer to an 8 byte buffer to receive copy of descriptor
  4314.  
  4315. Out:
  4316.        Carry = 0 if successful
  4317.         ES:EDI = Pointer to buffer that contains descriptor
  4318.  
  4319.  
  4320. ───────────────────────────────────────────────────────────────────────────────
  4321. Function 000Ch - Set Descriptor
  4322. ───────────────────────────────────────────────────────────────────────────────
  4323.  
  4324. In:
  4325.  
  4326.         AX = 000Ch
  4327.         BX = Selector
  4328.         ES:EDI = Pointer to an 8 byte buffer that contains descriptor
  4329.  
  4330. Out:
  4331.        Carry = 0 if successful
  4332.  
  4333.  
  4334. ───────────────────────────────────────────────────────────────────────────────
  4335. Function 0100h - Allocate DOS Memory Block
  4336. ───────────────────────────────────────────────────────────────────────────────
  4337.  
  4338. In:
  4339.  
  4340.         AX = 0100h
  4341.         BX = Number of paragraphs (16 byte blocks) desired
  4342.  
  4343. Out:
  4344.  
  4345.        Carry = 0 if successful
  4346.         AX = Initial real mode segment of allocated block
  4347.         DX = Selector for allocated block
  4348.  
  4349.        Carry = 1 if error
  4350.         AX = DOS error code:
  4351.              07h memory control blocks damaged
  4352.              08h insufficient memory available to allocate as requested
  4353.         BX = Size of largest available block in paragraphs
  4354.  
  4355.  
  4356. ───────────────────────────────────────────────────────────────────────────────
  4357. Function 0101h - Free DOS Memory Block
  4358. ───────────────────────────────────────────────────────────────────────────────
  4359.  
  4360. In:
  4361.  
  4362.         AX = 0101h
  4363.         DX = Selector of block to free
  4364.  
  4365. Out:
  4366.  
  4367.        Carry = 0 if successful
  4368.  
  4369.        Carry = 1 if error
  4370.         AX = DOS error code:
  4371.              07h memory control blocks damaged
  4372.              09h incorrect memory segment specified
  4373.  
  4374.  
  4375. ───────────────────────────────────────────────────────────────────────────────
  4376. Function 0102h - Resize DOS Memory Block
  4377. ───────────────────────────────────────────────────────────────────────────────
  4378.  
  4379. In:
  4380.  
  4381.         AX = 0102h
  4382.         BX = New block size in paragraphs
  4383.         DX = Selector of block to modify
  4384.  
  4385. Out:
  4386.  
  4387.        Carry = 0 if successful
  4388.  
  4389.        Carry = 1 if error
  4390.         AX = DOS error code:
  4391.              07h memory control blocks damaged
  4392.              08h insufficient memory  available to allocate as requested
  4393.              09h incorrect memory segment specified
  4394.         BX = Maximum block size possible in paragraphs
  4395.  
  4396.  
  4397. ───────────────────────────────────────────────────────────────────────────────
  4398. Function 0200h - Get Real Mode Interrupt Vector
  4399. ───────────────────────────────────────────────────────────────────────────────
  4400.  
  4401. In:
  4402.  
  4403.         AX = 0200h
  4404.         BL = Interrupt number
  4405.  
  4406. Out:
  4407.        Carry = 0 if successful
  4408.         CX:DX = Segment:Offset of real mode interrupt handler
  4409.  
  4410.  
  4411. ───────────────────────────────────────────────────────────────────────────────
  4412. Function 0201h - Set Real Mode Interrupt Vector
  4413. ───────────────────────────────────────────────────────────────────────────────
  4414.  
  4415. In:
  4416.  
  4417.         AX = 0201h
  4418.         BL = Interrupt number
  4419.         CX:DX = Segment:Offset of real mode interrupt handler
  4420.  
  4421. Out:
  4422.        Carry = 0 if successful
  4423.  
  4424.  
  4425. ───────────────────────────────────────────────────────────────────────────────
  4426. Function 0202h - Get Processor Exception Handler Vector
  4427. ───────────────────────────────────────────────────────────────────────────────
  4428.  
  4429. In:
  4430.  
  4431.         AX = 0202h
  4432.         BL = Exception/fault number (00h-1Fh)
  4433.  
  4434. Out:
  4435.  
  4436.        Carry = 0 if successful
  4437.         CX:EDX = Selector:Offset of exception handler
  4438.  
  4439.  
  4440. ───────────────────────────────────────────────────────────────────────────────
  4441. Function 0203h - Set Processor Exception Handler Vector
  4442. ───────────────────────────────────────────────────────────────────────────────
  4443.  
  4444.  
  4445. In:
  4446.  
  4447.         AX = 0203h
  4448.         BL = Exception/fault number (00h-1Fh)
  4449.         CX:EDX = Selector:Offset of exception handler
  4450.  
  4451. Out:
  4452.        Carry = 0 if successful
  4453.  
  4454.  
  4455. ───────────────────────────────────────────────────────────────────────────────
  4456. Function 0204h - Get Protected Mode Interrupt Vector
  4457. ───────────────────────────────────────────────────────────────────────────────
  4458.  
  4459. In:
  4460.  
  4461.         AX = 0204h
  4462.         BL = Interrupt number
  4463.  
  4464. Out:
  4465.        Carry = 0
  4466.         CX:EDX = Selector:Offset of exception handler
  4467.  
  4468.  
  4469. ───────────────────────────────────────────────────────────────────────────────
  4470. Function 0205h - Set Protected Mode Interrupt Vector
  4471. ───────────────────────────────────────────────────────────────────────────────
  4472.  
  4473. In:
  4474.  
  4475.         AX = 0205h
  4476.         BL = Interrupt number
  4477.         CX:EDX = Selector:Offset of exception handler
  4478.  
  4479. Out:
  4480.  
  4481.        Carry = 0 if successful
  4482.  
  4483.  
  4484. ───────────────────────────────────────────────────────────────────────────────
  4485. Function 0300h - Simulate Real Mode Interrupt
  4486. ───────────────────────────────────────────────────────────────────────────────
  4487.  
  4488. In:
  4489.  
  4490.         AX = 0300h
  4491.         BL = Interrupt number
  4492.         BH = 0
  4493.         CX = Number of words to copy from protected mode to real mode stack
  4494.         ES:EDI = Selector:Offset of real mode call structure
  4495.  
  4496. Out:
  4497.  
  4498.        Carry = 0 if successful
  4499.         ES:EDI = Selector:Offset of modified real mode call structure
  4500.                  in the folling format:
  4501.                 Offset  Length  Contents
  4502.                 00h     4       EDI
  4503.                 04h     4       ESI
  4504.                 08h     4       EBP
  4505.                 0ch     4       reserved, should be zero
  4506.                 10h     4       EBX
  4507.                 14h     4       EDX
  4508.                 18h     4       ECX
  4509.                 1ch     4       EAX
  4510.                 20h     2       CPU status flags
  4511.                 22h     2       ES
  4512.                 24h     2       DS
  4513.                 26h     2       FS
  4514.                 28h     2       GS
  4515.                 2ah     2       IP (reserved, ignored)
  4516.                 2ch     2       CS (reserved, ignored)
  4517.                 2eh     2       SP
  4518.                 30h     2       SS
  4519.  
  4520.  
  4521. ───────────────────────────────────────────────────────────────────────────────
  4522. Function 0301h - Call Real Mode Procedure With Far Return Frame
  4523. ───────────────────────────────────────────────────────────────────────────────
  4524.  
  4525. In:
  4526.  
  4527.         AX = 0301h
  4528.         BH = 0
  4529.         CX = Number of words to copy from protected mode to real mode stack
  4530.         ES:EDI = Selector:Offset of real mode call structure
  4531.  
  4532. Out:
  4533.  
  4534.        Carry = 0 if successful
  4535.         ES:EDI = Selector:Offset of  modified real mode call structure
  4536.                  in the folling format:
  4537.                 Offset  Length  Contents
  4538.                 00h     4       EDI
  4539.                 04h     4       ESI
  4540.                 08h     4       EBP
  4541.                 0ch     4       reserved, ingored
  4542.                 10h     4       EBX
  4543.                 14h     4       EDX
  4544.                 18h     4       ECX
  4545.                 1ch     4       EAX
  4546.                 20h     2       CPU status flags
  4547.                 22h     2       ES
  4548.                 24h     2       DS
  4549.                 26h     2       FS
  4550.                 28h     2       GS
  4551.                 2ah     2       IP
  4552.                 2ch     2       CS
  4553.                 2eh     2       SP
  4554.                 30h     2       SS
  4555.  
  4556.  
  4557. ───────────────────────────────────────────────────────────────────────────────
  4558. Function 0302h - Call Real Mode Procedure With Iret Frame
  4559. ───────────────────────────────────────────────────────────────────────────────
  4560.  
  4561. In:
  4562.  
  4563.         AX = 0302h
  4564.         BH = 0
  4565.         CX = Number of words to copy from protected mode to real mode stack
  4566.         ES:EDI = Selector:Offset of real mode call structure
  4567.  
  4568. Out:
  4569.  
  4570.        Carry = 0 if successful
  4571.         ES:EDI = Selector:Offset of modified real mode call structure
  4572.                 Offset  Length  Contents
  4573.                 00h     4       EDI
  4574.                 04h     4       ESI
  4575.                 08h     4       EBP
  4576.                 0ch     4       reserved, ingored
  4577.                 10h     4       EBX
  4578.                 14h     4       EDX
  4579.                 18h     4       ECX
  4580.                 1ch     4       EAX
  4581.                 20h     2       CPU status flags
  4582.                 22h     2       ES
  4583.                 24h     2       DS
  4584.                 26h     2       FS
  4585.                 28h     2       GS
  4586.                 2ah     2       IP
  4587.                 2ch     2       CS
  4588.                 2eh     2       SP
  4589.                 30h     2       SS
  4590.  
  4591.  
  4592. ───────────────────────────────────────────────────────────────────────────────
  4593. Function 0400h - Get Version
  4594. ───────────────────────────────────────────────────────────────────────────────
  4595.  
  4596. In:
  4597.  
  4598.         AX = 0400h
  4599.  
  4600. Out:
  4601.  
  4602.         AH = Major version
  4603.         AL = Minor version
  4604.         BX = Flags
  4605.         CL = Processor type
  4606.              02 = 80286
  4607.              03 = 80386
  4608.              04 = 80486
  4609.         DH = Current value of virtual master PIC base interrupt
  4610.         DL = Current value of virtual slave PIC base interrupt
  4611.        Carry = 0
  4612.  
  4613.  
  4614. ───────────────────────────────────────────────────────────────────────────────
  4615. Function 0500h - Get Free Memory Information
  4616. ───────────────────────────────────────────────────────────────────────────────
  4617.  
  4618. In:
  4619.  
  4620.         AX = 0500h
  4621.         ES:EDI = Selector:Offset of 30h byte buffer
  4622.  
  4623. Out:
  4624.  
  4625.        Carry = 0 if successful
  4626.         ES:EDI = Selector:Offset of buffer with the following structure
  4627.  
  4628.  
  4629. ───────────────────────────────────────────────────────────────────────────────
  4630. Function 0501h - Allocate Memory Block
  4631. ───────────────────────────────────────────────────────────────────────────────
  4632.  
  4633. In:
  4634.  
  4635.         AX = 0501h
  4636.         BX:CX = Size of memory block to allocate in bytes
  4637.  
  4638. Out:
  4639.  
  4640.        Carry = 0 if successful
  4641.         BX:CX = Linear address of allocated memory block
  4642.         SI:DI = Memory block handle (used to resize and free)
  4643.  
  4644.  
  4645. ───────────────────────────────────────────────────────────────────────────────
  4646. Function 0502h - Free Memory Block
  4647. ───────────────────────────────────────────────────────────────────────────────
  4648.  
  4649. In:
  4650.  
  4651.         AX = 0502h
  4652.         SI:DI = Handle of memory block to free
  4653.  
  4654. Out:
  4655.  
  4656.        Carry = 0 if successful
  4657.  
  4658.  
  4659. ───────────────────────────────────────────────────────────────────────────────
  4660. Function 0503h - Resize Memory Block
  4661. ───────────────────────────────────────────────────────────────────────────────
  4662.  
  4663.  
  4664. In:
  4665.  
  4666.         AX = 0503h
  4667.         BX:CX = New size of memory block to allocate in bytes
  4668.         SI:DI = Handle of memory block to resize
  4669.  
  4670. Out:
  4671.  
  4672.        Carry = 0 if successful
  4673.         BX:CX = New linear address of memory block
  4674.         SI:DI = New handle of memory block
  4675.  
  4676.  
  4677. ───────────────────────────────────────────────────────────────────────────────
  4678. Function 0800h - Physical Address Mapping
  4679. ───────────────────────────────────────────────────────────────────────────────
  4680.  
  4681. In:
  4682.  
  4683.         AX = 0800h
  4684.         BX:CX = Physical address of memory
  4685.         SI:DI = Size of region to map in bytes
  4686.  
  4687. Out:
  4688.  
  4689.        Carry = 0 if successful
  4690.         BX:CX =  Linear address  that can be used to access the physical memory
  4691.  
  4692.  
  4693. ───────────────────────────────────────────────────────────────────────────────
  4694. Function 0900h - Get and Disable Virtual Interrupt State
  4695. ───────────────────────────────────────────────────────────────────────────────
  4696.  
  4697. In:
  4698.  
  4699.         AX = 0900h
  4700.  
  4701. Out:
  4702.  
  4703.        Carry = 0
  4704.         AL = 0 if virtual interrupts were previously disabled
  4705.         AL = 1 if virtual interrupts were previously enabled
  4706.  
  4707.  
  4708. ───────────────────────────────────────────────────────────────────────────────
  4709. Function 0901h - Get and Enable Virtual Interrupt State
  4710. ───────────────────────────────────────────────────────────────────────────────
  4711.  
  4712. In:
  4713.  
  4714.         AX = 0901h
  4715.  
  4716. Out:
  4717.  
  4718.        Carry = 0
  4719.         AL = 0 if virtual interrupts were previously disabled
  4720.         AL = 1 if virtual interrupts were previously enabled
  4721.  
  4722.  
  4723. ───────────────────────────────────────────────────────────────────────────────
  4724. Function 0902h - Get Virtual Interrupt State
  4725. ───────────────────────────────────────────────────────────────────────────────
  4726.  
  4727. In:
  4728.  
  4729.         AX = 0902h
  4730.  
  4731. Out:
  4732.        Carry = 0
  4733.         AL = 0 if virtual interrupts are disabled
  4734.         AL = 1 if virtual interrupts are enabled
  4735.  
  4736.  
  4737. ╔══════════════════════════════════════════════════════════════════════════╗
  4738. ║                                                                          ║
  4739. ║ Les fonctions du DOS (interruption 21h) supportées par l'E.O.S           ║
  4740. ║                                                                          ║
  4741. ╚══════════════════════════════════════════════════════════════════════════╝
  4742.  
  4743. Function  1h - Keyboard Input with Echo
  4744. Function  2h - Display Output
  4745. Function  3h - Wait for Auxiliary Device Input
  4746. Function  4h - Auxiliary Output
  4747. Function  5h - Printer Output
  4748. Function  6h - Direct Console I/O
  4749. Function  7h - Direct Console Input Without Echo
  4750. Function  8h - Console Input Without Echo
  4751. Function  9h - Print String
  4752. Function  Ah - Buffered Keyboard Input
  4753. Function  Bh - Check Standard Input Status
  4754. Function  Ch - Clear Keyboard Buffer and Invoke Keyboard Function
  4755. Function  Dh - Disk Reset
  4756. Function  Eh - Select Disk
  4757. Function  Fh - Open a File Using FCB
  4758. Function 10h - Close a File Using FCB
  4759. Function 11h - Search for First Entry Using FCB
  4760. Function 12h - Search for Next Entry Using FCB
  4761. Function 13h - Delete File Using FCB
  4762. Function 14h - Sequential Read Using FCB
  4763. Function 15h - Sequential Write Using FCB
  4764. Function 16h - Create a File Using FCB
  4765. Function 17h - Rename a File Using FCB
  4766. Function 19h - Get Current Default Drive
  4767. Function 1Ah - Set Disk Transfer Address (DTA)
  4768. Function 21h - Random Read Using FCB
  4769. Function 22h - Random Write Using FCB
  4770. Function 23h - Get File Size Using FCB
  4771. Function 24h - Set Relative Record Field in FCB
  4772. Function 25h - Set Interrupt Vector
  4773. Function 27h - Random Block Read Using FCB
  4774. Function 28h - Random Block Write Using FCB
  4775. Function 2Ah - Get Date
  4776. Function 2Bh - Set Date
  4777. Function 2Ch - Get Time
  4778. Function 2Dh - Set Time
  4779. Function 2Eh - Set/Reset Verify Switch
  4780. Function 2Fh - Get Disk Transfer Address (DTA)
  4781. Function 30h - Get DOS Version Number
  4782. Function 33h - Get/Set System Values (Ctl-Break/Boot Drive)
  4783. Function 34h - Get Address to DOS Critical Flag
  4784. Function 35h - Get Interrupt Vector
  4785. Function 36h - Get Disk Free Space
  4786. Function 37h - Get/Set Switch Character
  4787. Function 39h - Create Subdirectory
  4788. Function 3Ah - Remove Subdirectory
  4789. Function 3Bh - Change Current Directory
  4790. Function 3Ch - Create File Using Handle
  4791. Function 3Dh - Open File Using Handle
  4792. Function 3Eh - Close File Using Handle
  4793. Function 3Fh - Read From File or Device Using Handle
  4794. Function 40h - Write To File or Device Using Handle
  4795. Function 41h - Delete File
  4796. Function 42h - Move File Pointer Using Handle
  4797. Function 43h - Get/Set File Attributes
  4798. Function 45h - Duplicate File Handle
  4799. Function 46h - Force Duplicate File Handle
  4800. Function 47h - Get Current Directory
  4801. Function 48h - Allocate Memory
  4802. Function 49h - Free Allocated Memory
  4803. Function 4Ah - Modify Allocated Memory Block  (SETBLOCK)
  4804. Function 4Bh - Load and Execute Program
  4805. Function 4Ch - Terminate Process With Return Code
  4806. Function 4Dh - Get Return Code of Sub-process
  4807. Function 4Eh - Find First Matching File
  4808. Function 4Fh - Find Next Matching File
  4809. Function 54h - Get Verify Setting
  4810. Function 56h - Rename File
  4811. Function 58h - Get/Set Memory Allocation Strategy
  4812. Function 59h - Get Extended Error Information
  4813. Function 5Ah - Create Temporary File
  4814. Function 5Bh - Create File
  4815. Function 60h - Get Fully Qualified File Name
  4816.  
  4817.  
  4818. ───────────────────────────────────────────────────────────────────────────────
  4819. Function 1h - Keyboard Input with Echo
  4820. ───────────────────────────────────────────────────────────────────────────────
  4821.  
  4822. In:
  4823.     AH = 01
  4824. Out:
  4825.     AL = character from standard input device
  4826.  
  4827.  
  4828. ───────────────────────────────────────────────────────────────────────────────
  4829. Function 2h - Display Output
  4830. ───────────────────────────────────────────────────────────────────────────────
  4831.  
  4832. In:
  4833.     AH = 02
  4834.     DL = character to output
  4835. Out:
  4836.  
  4837.  
  4838. ───────────────────────────────────────────────────────────────────────────────
  4839. Function 3h - Wait for Auxiliary Device Input
  4840. ───────────────────────────────────────────────────────────────────────────────
  4841.  
  4842. In:
  4843.     AH = 03
  4844. Out:
  4845.     AL = character from the auxiliary device
  4846.  
  4847.  
  4848. ───────────────────────────────────────────────────────────────────────────────
  4849. Function 4h - Auxiliary Output
  4850. ───────────────────────────────────────────────────────────────────────────────
  4851.  
  4852. In:
  4853.     AH = 04
  4854.     DL = character to output
  4855. Out:
  4856.  
  4857.  
  4858. ───────────────────────────────────────────────────────────────────────────────
  4859. Function 5h - Printer Output
  4860. ───────────────────────────────────────────────────────────────────────────────
  4861.  
  4862. In:
  4863.     AH = 05
  4864.     DL = character to output
  4865. Out:
  4866.  
  4867.  
  4868. ───────────────────────────────────────────────────────────────────────────────
  4869. Function 6h - Direct Console I/O
  4870. ───────────────────────────────────────────────────────────────────────────────
  4871.  
  4872. In:
  4873.     AH = 06
  4874.     DL = (0-FE) character to output
  4875.        = FF if console input request
  4876. Out:
  4877.     AL = input character if console input request (DL=FF)
  4878.     ZF = 0    if console request character available (in AL)
  4879.        = 1    if no character is ready, and function request
  4880.          was console input
  4881.  
  4882.  
  4883. ───────────────────────────────────────────────────────────────────────────────
  4884. Function 7h - Direct Console Input Without Echo
  4885. ───────────────────────────────────────────────────────────────────────────────
  4886.  
  4887. In:
  4888.     AH = 07
  4889. Out:
  4890.     AL = character from STDIN
  4891.  
  4892.  
  4893. ───────────────────────────────────────────────────────────────────────────────
  4894. Function 8h - Console Input Without Echo
  4895. ───────────────────────────────────────────────────────────────────────────────
  4896.  
  4897. In:
  4898.     AH = 08
  4899. Out:
  4900.     AL = character from STDIN
  4901.  
  4902.  
  4903. ───────────────────────────────────────────────────────────────────────────────
  4904. Function 9h - Print String
  4905. ───────────────────────────────────────────────────────────────────────────────
  4906.  
  4907. In:
  4908.     AH = 09
  4909.         DS:EDX = pointer to string ending in "$"
  4910. Out:
  4911.  
  4912.  
  4913. ───────────────────────────────────────────────────────────────────────────────
  4914. Function Ah - Buffered Keyboard Input
  4915. ───────────────────────────────────────────────────────────────────────────────
  4916.  
  4917. In:
  4918.     AH = 0A
  4919.         DS:EDX = pointer to input buffer
  4920. Out:
  4921.  
  4922.  
  4923. ───────────────────────────────────────────────────────────────────────────────
  4924. Function Bh - Check Standard Input Status
  4925. ───────────────────────────────────────────────────────────────────────────────
  4926.  
  4927. In:
  4928.     AH = 0B
  4929. Out:
  4930.     AL = 00 if no character available
  4931.        = FF if character available
  4932.  
  4933.  
  4934. ───────────────────────────────────────────────────────────────────────────────
  4935. Function Ch - Clear Keyboard Buffer and Invoke Keyboard Function
  4936. ───────────────────────────────────────────────────────────────────────────────
  4937.  
  4938. In:
  4939.     AH = 0C
  4940.     AL = 01, 06, 07, 08 or 0A   (INT 21 input functions)
  4941. Out:
  4942.  
  4943.  
  4944. ───────────────────────────────────────────────────────────────────────────────
  4945. Function Dh - Disk Reset
  4946. ───────────────────────────────────────────────────────────────────────────────
  4947.  
  4948. In:
  4949.     AH = 0D
  4950. Out:
  4951.  
  4952.  
  4953. ───────────────────────────────────────────────────────────────────────────────
  4954. Function Eh - Select Disk
  4955. ───────────────────────────────────────────────────────────────────────────────
  4956.  
  4957. In:
  4958.     AH = 0E
  4959.         DL = zero based, drive number (0-25, A:h - Z:)
  4960. Out:
  4961.     AL = one based, total number of logical drives including
  4962.          hardfiles (1-26)
  4963.  
  4964.  
  4965. ───────────────────────────────────────────────────────────────────────────────
  4966. Function Fh - Open a File Using FCB
  4967. ───────────────────────────────────────────────────────────────────────────────
  4968.  
  4969. In:
  4970.     AH = 0F
  4971.         DS:EDX = pointer to unopened FCB
  4972.  
  4973. Out:
  4974.     AL = 00 if file opened
  4975.        = FF if unable to open
  4976.  
  4977.  
  4978. ───────────────────────────────────────────────────────────────────────────────
  4979. Function 10h - Close a File Using FCB
  4980. ───────────────────────────────────────────────────────────────────────────────
  4981.  
  4982. In:
  4983.     AH = 10h
  4984.         DS:EDX = pointer to opened FCB
  4985. Out:
  4986.     AL = 00  if file closed
  4987.        = FF  if file not closed
  4988.  
  4989.  
  4990. ───────────────────────────────────────────────────────────────────────────────
  4991. Function 11h - Search for First Entry Using FCB
  4992. ───────────────────────────────────────────────────────────────────────────────
  4993.  
  4994. In:
  4995.     AH = 11h
  4996.         DS:EDX = pointer to unopened FCB
  4997. Out:
  4998.     AL = 00 if matching file found
  4999.        = FF if file not found
  5000.  
  5001.  
  5002. ───────────────────────────────────────────────────────────────────────────────
  5003. Function 12h - Search for Next Entry Using FCB
  5004. ───────────────────────────────────────────────────────────────────────────────
  5005.  
  5006. In:
  5007.     AH = 12h
  5008.         DS:EDX = pointer to unopened FCB
  5009. Out:
  5010.     AL = 00 if file found
  5011.        = FF if file not found
  5012.  
  5013.  
  5014. ───────────────────────────────────────────────────────────────────────────────
  5015. Function 13h - Delete File Using FCB
  5016. ───────────────────────────────────────────────────────────────────────────────
  5017.  
  5018. In:
  5019.     AH = 13h
  5020.         DS:EDX = pointer to an unopened FCB
  5021. Out:
  5022.     AL = 00 if file deleted
  5023.        = FF if file not found
  5024.  
  5025.  
  5026. ───────────────────────────────────────────────────────────────────────────────
  5027. Function 14h - Sequential Read Using FCB
  5028. ───────────────────────────────────────────────────────────────────────────────
  5029.  
  5030. In:
  5031.     AH = 14h
  5032.         DS:EDX = pointer to an opened FCB
  5033. Out:
  5034.     AL = 00 if successful read
  5035.        = 01 if end of file (no data read)
  5036.            = 02 if DTA is too small
  5037.        = 03 if end of file or partial record read
  5038.  
  5039.  
  5040. ───────────────────────────────────────────────────────────────────────────────
  5041. Function 15h - Sequential Write Using FCB
  5042. ───────────────────────────────────────────────────────────────────────────────
  5043.  
  5044. In:
  5045.     AH = 15h
  5046.         DS:EDX = pointer to an opened FCB
  5047.  
  5048. Out:
  5049.     AL = 00 if write was successful
  5050.        = 01 if diskette is full or read only
  5051.            = 02 if DTA is too small
  5052.  
  5053.  
  5054. ───────────────────────────────────────────────────────────────────────────────
  5055. Function 16h - Create a File Using FCB
  5056. ───────────────────────────────────────────────────────────────────────────────
  5057.  
  5058.  
  5059. In:
  5060.     AH = 16h
  5061.         DS:EDX = pointer to an unopened FCB
  5062. Out:
  5063.     AL = 00 if file created
  5064.        = FF if file creation failed
  5065.  
  5066.  
  5067. ───────────────────────────────────────────────────────────────────────────────
  5068. Function 17h - Rename a File Using FCB
  5069. ───────────────────────────────────────────────────────────────────────────────
  5070.  
  5071. In:
  5072.     AH = 17h
  5073.         DS:EDX = pointer to a modified FCB
  5074. Out:
  5075.     AL = 00 if file renamed
  5076.        = FF if file not renamed
  5077.  
  5078.  
  5079. ───────────────────────────────────────────────────────────────────────────────
  5080. Function 19h - Get Current Default Drive
  5081. ───────────────────────────────────────────────────────────────────────────────
  5082.  
  5083. In:
  5084.     AH = 19h
  5085. Out:
  5086.     AL = current default drive (0=A,1=B,etc)
  5087.  
  5088.  
  5089. ───────────────────────────────────────────────────────────────────────────────
  5090. Function 1Ah - Set Disk Transfer Address (DTA)
  5091. ───────────────────────────────────────────────────────────────────────────────
  5092.  
  5093. In:
  5094.     AH = 1A
  5095.         DS:EDX = pointer to DTA
  5096. Out:
  5097.  
  5098.  
  5099. ───────────────────────────────────────────────────────────────────────────────
  5100. Function 21h - Random Read Using FCB
  5101. ───────────────────────────────────────────────────────────────────────────────
  5102.  
  5103. In:
  5104.     AH = 21h
  5105.         DS:EDX = pointer to an opened FCB
  5106. Out:
  5107.     AL = 00 if read successful
  5108.        = 01 if EOF (no data read)
  5109.            = 02 if DTA is too small
  5110.        = 03 if EOF (partial record read)
  5111.  
  5112.  
  5113. ───────────────────────────────────────────────────────────────────────────────
  5114. Function 22h - Random Write Using FCB
  5115. ───────────────────────────────────────────────────────────────────────────────
  5116.  
  5117.  
  5118. In:
  5119.     AH = 22h
  5120.         DS:EDX = far pointer to an opened FCB
  5121.  
  5122. Out:
  5123.     AL = 00 if write successful
  5124.        = 01 if diskette full or read only
  5125.            = 02 if DTA is too small
  5126.  
  5127.  
  5128. ───────────────────────────────────────────────────────────────────────────────
  5129. Function 23h - Get File Size Using FCB
  5130. ───────────────────────────────────────────────────────────────────────────────
  5131.  
  5132. In:
  5133.     AH = 23h
  5134.         DS:EDX = pointer to an unopened FCB
  5135. Out:
  5136.     AL = 00 if successful
  5137.        = FF if file not found
  5138.  
  5139.  
  5140. ───────────────────────────────────────────────────────────────────────────────
  5141. Function 24h - Set Relative Record Field in FCB
  5142. ───────────────────────────────────────────────────────────────────────────────
  5143.  
  5144. In:
  5145.     AH = 24h
  5146.         DS:EDX = pointer to an opened FCB
  5147.  
  5148. Out:
  5149.  
  5150.  
  5151. ───────────────────────────────────────────────────────────────────────────────
  5152. Function 25h - Set Interrupt Vector
  5153. ───────────────────────────────────────────────────────────────────────────────
  5154.  
  5155. In:
  5156.     AH = 25h
  5157.     AL = interrupt number
  5158.         DS:EDX = pointer to interrupt handler
  5159. Out:
  5160.  
  5161.  
  5162. ───────────────────────────────────────────────────────────────────────────────
  5163. Function 27h - Random Block Read Using FCB
  5164. ───────────────────────────────────────────────────────────────────────────────
  5165.  
  5166. In:
  5167.     AH = 27h
  5168.     CX = number of records to read
  5169.         DS:EDX = pointer to an opened FCB
  5170. Out:
  5171.     AL = 00 if read was successful
  5172.        = 01 if EOF (no data read)
  5173.            = 02 if DTA is too small
  5174.        = 03 if EOF (partial record read)
  5175.     CX = actual number of records read
  5176.  
  5177.  
  5178. ───────────────────────────────────────────────────────────────────────────────
  5179. Function 28h - Random Block Write Using FCB
  5180. ───────────────────────────────────────────────────────────────────────────────
  5181.  
  5182.  
  5183. In:
  5184.     AH = 28h
  5185.     CX = number of records to write
  5186.         DS:EDX = pointer to an opened FCB
  5187.  
  5188. Out:
  5189.     AL = 00 if write successful
  5190.        = 01 if diskette full or read only
  5191.            = 02 if DTA is too small
  5192.     CX = number of records written
  5193.  
  5194.  
  5195. ───────────────────────────────────────────────────────────────────────────────
  5196. Function 2Ah - Get Date
  5197. ───────────────────────────────────────────────────────────────────────────────
  5198.  
  5199. In:
  5200.     AH = 2A
  5201. Out:
  5202.     AL = day of the week (0=Sunday)
  5203.     CX = year (1980-2099)
  5204.     DH = month (1-12)
  5205.     DL = day (1-31)
  5206.  
  5207.  
  5208. ───────────────────────────────────────────────────────────────────────────────
  5209. Function 2Bh - Set Date
  5210. ───────────────────────────────────────────────────────────────────────────────
  5211.  
  5212. IN:
  5213.     AH = 2B
  5214.     CX = year (1980-2099)
  5215.     DH = month (1-12)
  5216.     DL = day (1-31)
  5217. Out:
  5218.     AL = 00 if date change successful
  5219.        = FF if invalid date
  5220.  
  5221.  
  5222. ───────────────────────────────────────────────────────────────────────────────
  5223. Function 2Ch - Get Time
  5224. ───────────────────────────────────────────────────────────────────────────────
  5225.  
  5226. In:
  5227.     AH = 2C
  5228. Out:
  5229.     CH = hour (0-23)
  5230.     CL = minutes (0-59)
  5231.     DH = seconds (0-59)
  5232.     DL = hundredths (0-99)
  5233.  
  5234.  
  5235. ───────────────────────────────────────────────────────────────────────────────
  5236. Function 2Dh - Set Time
  5237. ───────────────────────────────────────────────────────────────────────────────
  5238.  
  5239. In:
  5240.     AH = 2D
  5241.     CH = hour (0-23)
  5242.     CL = minutes (0-59)
  5243.     DH = seconds (0-59)
  5244.     DL = hundredths (0-99)
  5245.  
  5246. Out:
  5247.     AL = 00 if time change successful
  5248.        = FF if time invalid
  5249.  
  5250.  
  5251. ───────────────────────────────────────────────────────────────────────────────
  5252. Function 2Eh - Set/Reset Verify Switch
  5253. ───────────────────────────────────────────────────────────────────────────────
  5254.  
  5255. In:
  5256.     AH = 2E
  5257.     AL = 00 to set off
  5258.        = 01 to set verify on
  5259.     DH = 00 for DOS versions before 3.0
  5260. Out:
  5261.  
  5262. ───────────────────────────────────────────────────────────────────────────────
  5263. Function 2Fh - Get Disk Transfer Address (DTA)
  5264. ───────────────────────────────────────────────────────────────────────────────
  5265.  
  5266. In:
  5267.     AH = 2F
  5268. Out:
  5269.         ES:EBX = pointer to current DTA
  5270.  
  5271.  
  5272. ───────────────────────────────────────────────────────────────────────────────
  5273. Function 30h - Get DOS Version Number
  5274. ───────────────────────────────────────────────────────────────────────────────
  5275.  
  5276. In:
  5277.     AH = 30h
  5278. Out:
  5279.     AL = major version number (2-5)
  5280.     AH = minor version number (in hundredths decimal)
  5281.  
  5282.  
  5283. ───────────────────────────────────────────────────────────────────────────────
  5284. Function 33h - Get/Set System Values (Ctl-Break/Boot Drive)
  5285. ───────────────────────────────────────────────────────────────────────────────
  5286.  
  5287. In:
  5288.     AH = 33h
  5289.     AL = 00 to get Ctrl-Break checking flag
  5290.        = 01 to set Ctrl-Break checking flag
  5291.        = 02 to set extended Ctrl-Break checking
  5292.            = 05 get boot drive
  5293.     DL = 00 to set Ctrl-Break checking off
  5294.        = 01 to set Ctrl-Break checking on
  5295.            = boot drive for subfunction 5
  5296.  
  5297. Out:
  5298.     DL = 00 Ctrl-Break checking OFF (AL=0 or AL=2)
  5299.        = 01 Ctrl-Break checking ON    (AL=0 or AL=2)
  5300.            = boot drive number (1-26, A:h - Z:) (AL=5)
  5301.  
  5302.  
  5303. ───────────────────────────────────────────────────────────────────────────────
  5304. Function 34h - Get Address to DOS Critical Flag
  5305. ───────────────────────────────────────────────────────────────────────────────
  5306.  
  5307. In:
  5308.     AH = 34h
  5309. Out:
  5310.         ES:EBX = address of a byte indicating whether a DOS call is
  5311.         in progress.  No DOS calls should be made if set.
  5312.  
  5313.  
  5314. ───────────────────────────────────────────────────────────────────────────────
  5315. Function 35h - Get Interrupt Vector
  5316. ───────────────────────────────────────────────────────────────────────────────
  5317.  
  5318. In:
  5319.     AH = 35h
  5320.     AL = interrupt vector number
  5321. Out:
  5322.         ES:EBX = pointer to interrupt handler
  5323.  
  5324.  
  5325. ───────────────────────────────────────────────────────────────────────────────
  5326. Function 36h - Get Disk Free Space
  5327. ───────────────────────────────────────────────────────────────────────────────
  5328.  
  5329. In:
  5330.     AH = 36h
  5331.         DL = drive number
  5332. Out:
  5333.     AX = sectors per cluster
  5334.        = FFFF if drive is invalid
  5335.     BX = number of available clusters
  5336.     CX = number of bytes per sector
  5337.     DX = number of clusters per drive
  5338.  
  5339.  
  5340. ───────────────────────────────────────────────────────────────────────────────
  5341. Function 37h - Get/Set Switch Character
  5342. ───────────────────────────────────────────────────────────────────────────────
  5343.  
  5344. In:
  5345.     AH = 37h
  5346.     AL = 0    get switch character into DL;  some systems return "-"
  5347.        = 1    set switch character to value in DL
  5348.        = 2    read device prefix flag into DL;  returns DL = 0 indicating
  5349.         devices must be accessed using /DEV/device. A non-zero value
  5350.         indicates devices may be accessed without prefix
  5351.        = 3    set device prefix flag, device names must begin with \DEV\.
  5352.     DL = new switch character (AL=1)
  5353.        = 00  \DEV\ must preceed device names (AL=3)
  5354.            = 01  \DEV\ is not neccesary in device names (AL=3)
  5355. Out:
  5356.     AL = FF  illegal subfunction code specified
  5357.     DL = current switch character (AL=0)
  5358.        = device availability (AL=2, always FF with DOS 4.x+)
  5359.  
  5360.  
  5361. ───────────────────────────────────────────────────────────────────────────────
  5362. Function 39h - Create Subdirectory
  5363. ───────────────────────────────────────────────────────────────────────────────
  5364.  
  5365. In:
  5366.     AH = 39h
  5367.         DS:EDX = pointer to ASCIIZ path name
  5368. Out:
  5369.        Carry = 0 if successful
  5370.  
  5371.        Carry = 1 if error
  5372.         EAX = error code
  5373.  
  5374.  
  5375. ───────────────────────────────────────────────────────────────────────────────
  5376. Function 3Ah - Remove Subdirectory
  5377. ───────────────────────────────────────────────────────────────────────────────
  5378.  
  5379.  
  5380. In:
  5381.     AH = 3A
  5382.         DS:EDX = pointer to ASCIIZ path name
  5383. Out:
  5384.        Carry = 0 if successful
  5385.  
  5386.        Carry = 1 if error
  5387.         EAX = error code
  5388.  
  5389.  
  5390. ───────────────────────────────────────────────────────────────────────────────
  5391. Function 3Bh - Change Current Directory
  5392. ───────────────────────────────────────────────────────────────────────────────
  5393.  
  5394. In:
  5395.     AH = 3B
  5396.         DS:EDX = pointer to ASCIIZ path name
  5397. Out:
  5398.        Carry = 0 if successful
  5399.  
  5400.        Carry = 1 if error
  5401.         EAX = error code
  5402.  
  5403.  
  5404. ───────────────────────────────────────────────────────────────────────────────
  5405. Function 3Ch - Create File Using Handle
  5406. ───────────────────────────────────────────────────────────────────────────────
  5407.  
  5408.  
  5409.     AH = 3C
  5410.         CX = file attribute
  5411.         DS:EDX = pointer to ASCIIZ path name
  5412. Out:
  5413.        Carry = 0 if successful
  5414.         AX = files handle
  5415.        Carry = 1 if error
  5416.         EAX = error code
  5417.  
  5418.  
  5419. ───────────────────────────────────────────────────────────────────────────────
  5420. Function 3Dh - Open File Using Handle
  5421. ───────────────────────────────────────────────────────────────────────────────
  5422.  
  5423.     AH = 3D
  5424.     AL = open access mode
  5425.         DS:EDX = pointer to an ASCIIZ file name
  5426. Out:
  5427.        Carry = 0 if successful
  5428.         AX = files handle
  5429.        Carry = 1 if error
  5430.         EAX = error code
  5431.  
  5432.  
  5433. ───────────────────────────────────────────────────────────────────────────────
  5434. Function 3Eh - Close File Using Handle
  5435. ───────────────────────────────────────────────────────────────────────────────
  5436.  
  5437. In:
  5438.     AH = 3E
  5439.     BX = file handle to close
  5440. Out:
  5441.        Carry = 0 if successful
  5442.  
  5443.        Carry = 1 if error
  5444.         EAX = error code
  5445.  
  5446.  
  5447. ───────────────────────────────────────────────────────────────────────────────
  5448. Function 3Fh - Read From File or Device Using Handle
  5449. ───────────────────────────────────────────────────────────────────────────────
  5450.  
  5451. In:
  5452.     AH = 3F
  5453.     BX = file handle
  5454.         ECX = number of bytes to read
  5455.         DS:EDX = pointer to read buffer
  5456. Out:
  5457.        Carry = 0 if successful
  5458.         EAX = Number of bytes readen
  5459.        Carry = 1 if error
  5460.         EAX = error code
  5461.  
  5462.  
  5463. ───────────────────────────────────────────────────────────────────────────────
  5464. Function 40h - Write To File or Device Using Handle
  5465. ───────────────────────────────────────────────────────────────────────────────
  5466.  
  5467. In:
  5468.     AH = 40h
  5469.     BX = file handle
  5470.         ECX = number of bytes to write
  5471.         DS:EDX = pointer to write buffer
  5472. Out:
  5473.        Carry = 0 if successful
  5474.         EAX = Number of bytes written
  5475.        Carry = 1 if error
  5476.         EAX = error code
  5477.  
  5478.  
  5479. ───────────────────────────────────────────────────────────────────────────────
  5480. Function 41h - Delete File
  5481. ───────────────────────────────────────────────────────────────────────────────
  5482.  
  5483. In:
  5484.     AH = 41h
  5485.         DS:EDX = pointer to an ASCIIZ filename
  5486. Out:
  5487.        Carry = 0 if successful
  5488.  
  5489.        Carry = 1 if error
  5490.         EAX = error code
  5491.  
  5492.  
  5493. ───────────────────────────────────────────────────────────────────────────────
  5494. Function 42h - Move File Pointer Using Handle
  5495. ───────────────────────────────────────────────────────────────────────────────
  5496.  
  5497. In:
  5498.     AH = 42h
  5499.         AL = origin of move
  5500.     BX = file handle
  5501.     CX = high order word of number of bytes to move
  5502.     DX = low order word of number of bytes to move
  5503.  
  5504. Out:
  5505.        Carry = 0 if successful
  5506.         DX:AX = new pointer location
  5507.        Carry = 1 if error
  5508.         EAX = error code
  5509.  
  5510.  
  5511. ───────────────────────────────────────────────────────────────────────────────
  5512. Function 43h - Get/Set File Attributes
  5513. ───────────────────────────────────────────────────────────────────────────────
  5514.  
  5515. In:
  5516.     AH = 43h
  5517.     AL = 00 to get attribute
  5518.        = 01 to set attribute
  5519.         DS:EDX = pointer to an ASCIIZ path name
  5520.     CX = attribute to set
  5521. Out:
  5522.        Carry = 0 if successful
  5523.  
  5524.        Carry = 1 if error
  5525.         EAX = error code
  5526.  
  5527.  
  5528. ───────────────────────────────────────────────────────────────────────────────
  5529. Function 45h - Duplicate File Handle
  5530. ───────────────────────────────────────────────────────────────────────────────
  5531.  
  5532. In:
  5533.     AH = 45h
  5534.     BX = file handle
  5535. Out:
  5536.        Carry = 0 if successful
  5537.         AX = New handle
  5538.        Carry = 1 if error
  5539.         EAX = error code
  5540.  
  5541.  
  5542. ───────────────────────────────────────────────────────────────────────────────
  5543. Function 46h - Force Duplicate File Handle
  5544. ───────────────────────────────────────────────────────────────────────────────
  5545.  
  5546. In:
  5547.     AH = 46h
  5548.     BX = existing file handle
  5549.     CX = second file handle
  5550. Out:
  5551.        Carry = 0 if successful
  5552.  
  5553.        Carry = 1 if error
  5554.         EAX = error code
  5555.  
  5556.  
  5557. ───────────────────────────────────────────────────────────────────────────────
  5558. Function 47h - Get Current Directory
  5559. ───────────────────────────────────────────────────────────────────────────────
  5560.  
  5561. In:
  5562.     AH = 47h
  5563.         DL = drive number
  5564.         DS:ESI = pointer to a 64 byte user buffer
  5565. Out:
  5566.        Carry = 0 if successful
  5567.         DS:ESI = pointer ASCIIZ directory path string
  5568.        Carry = 1 if error
  5569.         EAX = error code
  5570.  
  5571.  
  5572. ───────────────────────────────────────────────────────────────────────────────
  5573. Function 48h - Allocate Memory
  5574. ───────────────────────────────────────────────────────────────────────────────
  5575.  
  5576. In:
  5577.     AH = 48h
  5578.     BX = number of memory paragraphs requested
  5579. Out:
  5580.        Carry = 0 if successful
  5581.         EAX = selector for memory block
  5582.         EBX = ??????
  5583.  
  5584.        Carry = 1 if error
  5585.         EAX = error code
  5586.         EBX = size in paras of the largest block of memory available
  5587. Notes:
  5588.         EBX may be random
  5589.  
  5590.  
  5591. ───────────────────────────────────────────────────────────────────────────────
  5592. Function 49h - Free Allocated Memory
  5593. ───────────────────────────────────────────────────────────────────────────────
  5594.  
  5595.  
  5596. In:
  5597.     AH = 49h
  5598.         ES = selector of the memory block
  5599. Out:
  5600.        Carry = 0 if successful
  5601.         EBX = ??????
  5602.  
  5603.        Carry = 1 if error
  5604.         EAX = error code
  5605. Notes:
  5606.         EBX may be random
  5607.  
  5608.  
  5609. ───────────────────────────────────────────────────────────────────────────────
  5610. Function 4Ah - Modify Allocated Memory Block  (SETBLOCK)
  5611. ───────────────────────────────────────────────────────────────────────────────
  5612.  
  5613. In:
  5614.     AH = 4A
  5615.     BX = new requested block size in paragraphs
  5616.     ES = segment of the block (~MCB~ + 1 para)
  5617. Out:
  5618.        Carry = 0 if successful
  5619.         EBX = ??????
  5620.  
  5621.        Carry = 1 if error
  5622.         EAX = error code
  5623.         EBX = size in paras of the largest block of memory available
  5624.  
  5625.  
  5626. ───────────────────────────────────────────────────────────────────────────────
  5627. Function 4Bh - Load and Execute Program
  5628. ───────────────────────────────────────────────────────────────────────────────
  5629.  
  5630. In:
  5631.     AH = 4B
  5632.     AL = 00  to load and execute program
  5633.         DS:EDX = pointer to an ASCIIZ filename
  5634.         ES:EBX = pointer to a parameter block
  5635. Out:
  5636.        Carry = 0 if successful
  5637.  
  5638.        Carry = 1 if error
  5639.         EAX = error code
  5640.  
  5641.  
  5642. ───────────────────────────────────────────────────────────────────────────────
  5643. Function 4Ch - Terminate Process With Return Code
  5644. ───────────────────────────────────────────────────────────────────────────────
  5645.  
  5646. In:
  5647.     AH = 4C
  5648.         AL = return code
  5649. Out:
  5650.  
  5651.  
  5652. ───────────────────────────────────────────────────────────────────────────────
  5653. Function 4Dh - Get Return Code of Sub-process
  5654. ───────────────────────────────────────────────────────────────────────────────
  5655.  
  5656. In:
  5657.     AH = 4D
  5658. Out:
  5659.     AH = system exit code  (indicates normal termination)
  5660.        = 00 for normal termination
  5661.        = 01 if terminated by ctl-break
  5662.        = 02 if critical device error
  5663.     AL = child exit code
  5664.  
  5665.  
  5666. ───────────────────────────────────────────────────────────────────────────────
  5667. Function 4Eh - Find First Matching File
  5668. ───────────────────────────────────────────────────────────────────────────────
  5669.  
  5670. In:
  5671.     AH = 4E
  5672.         CX = attribute used during search
  5673.         DS:EDX = pointer to ASCIIZ filespec
  5674. Out:
  5675.        Carry = 0 if successful
  5676.  
  5677.        Carry = 1 if error
  5678.         EAX = error code
  5679.  
  5680.  
  5681. ───────────────────────────────────────────────────────────────────────────────
  5682. Function 4Fh - Find Next Matching File
  5683. ───────────────────────────────────────────────────────────────────────────────
  5684.  
  5685. In:
  5686.     AH = 4F
  5687.         DS:EDX = unchanged from previous function 4E
  5688. Out:
  5689.        Carry = 0 if successful
  5690.  
  5691.        Carry = 1 if error
  5692.         EAX = error code
  5693.  
  5694.  
  5695. ───────────────────────────────────────────────────────────────────────────────
  5696. Function 54h - Get Verify Setting
  5697. ───────────────────────────────────────────────────────────────────────────────
  5698.  
  5699. In:
  5700.     AH = 54h
  5701. Out:
  5702.     AL = 00  verify off
  5703.        = 01  verify on
  5704.  
  5705.  
  5706. ───────────────────────────────────────────────────────────────────────────────
  5707. Function 56h - Rename File
  5708. ───────────────────────────────────────────────────────────────────────────────
  5709.  
  5710. In:
  5711.     AH = 56h
  5712.         DS:EDX = pointer to old ASCIIZ path/filename
  5713.         ES:EDI = pointer to new ASCIIZ path/filename
  5714. Out:
  5715.        Carry = 0 if successful
  5716.  
  5717.        Carry = 1 if error
  5718.         EAX = error code
  5719.  
  5720.  
  5721. ───────────────────────────────────────────────────────────────────────────────
  5722. Function 58h - Get/Set Memory Allocation Strategy
  5723. ───────────────────────────────────────────────────────────────────────────────
  5724.  
  5725. In:
  5726.     AH = 58h
  5727.     AL = 00  get strategy code
  5728.        = 01  set strategy code
  5729.     BX = strategy code (when AL = 01)
  5730.        = 00  first fit  (default)
  5731.        = 01  best fit
  5732.        = 02  last fit
  5733. Out:
  5734.        Carry = 0 if successful
  5735.  
  5736.        Carry = 1 if error
  5737.         EAX = error code
  5738.  
  5739.  
  5740. ───────────────────────────────────────────────────────────────────────────────
  5741. Function 59h - Get Extended Error Information
  5742. ───────────────────────────────────────────────────────────────────────────────
  5743.  
  5744. In:
  5745.     AH = 59h
  5746.         BX = 00
  5747. Out:
  5748.        Carry = 0 if successful
  5749.         AX = error code
  5750.         BH = error class
  5751.     BL = suggested action
  5752.     CH = locus
  5753.  
  5754.        Carry = 1 if error
  5755.  
  5756.  
  5757. ───────────────────────────────────────────────────────────────────────────────
  5758. Function 5Ah - Create Temporary File
  5759. ───────────────────────────────────────────────────────────────────────────────
  5760.  
  5761. In:
  5762.     AH = 5A
  5763.     CX = attribute
  5764.         DS:EDX = pointer to ASCIIZ path ending in '\'
  5765. Out:
  5766.        Carry = 0 if successful
  5767.         AX = handle
  5768.         DS:EDX = pointer to updated ASCIIZ filespec
  5769.  
  5770.        Carry = 1 if error
  5771.         EAX = error code
  5772.  
  5773.  
  5774. ───────────────────────────────────────────────────────────────────────────────
  5775. Function 5Bh - Create File
  5776. ───────────────────────────────────────────────────────────────────────────────
  5777.  
  5778.  
  5779.     AH = 5B
  5780.     CX = attribute
  5781.         DS:EDX = pointer to ASCIIZ path/filename
  5782.  
  5783.  
  5784.        Carry = 0 if successful
  5785.         AX = handle
  5786.  
  5787.        Carry = 1 if error
  5788.         EAX = error code
  5789.  
  5790.  
  5791. ───────────────────────────────────────────────────────────────────────────────
  5792. Function 60h - Get Fully Qualified File Name
  5793. ───────────────────────────────────────────────────────────────────────────────
  5794.  
  5795. In:
  5796.     AH = 60h
  5797.         DS:ESI = pointer to ASCIIZ string containing unqualified filename
  5798.         ES:EDI = pointer to 128 byte buffer to contain fully qualified filename
  5799. Out:
  5800.        Carry = 0 if successful
  5801.         ES:EDI = address of fully qualified filename string
  5802.  
  5803.        Carry = 1 if error
  5804.         EAX = error code
  5805.  
  5806.  
  5807. ╔══════════════════════════════════════════════════════════════════════════╗
  5808. ║                                                                          ║
  5809. ║ Fin de la documentation EOS                                              ║
  5810. ║                                                                          ║
  5811. ╚══════════════════════════════════════════════════════════════════════════╝